feat: support get user by name api
This commit is contained in:
parent
25cad60ef8
commit
2096e6ea8d
|
@ -206,7 +206,7 @@ func configRoutes(r *gin.Engine) {
|
|||
|
||||
v1.GET("/can-do-op-by-name", login(), canDoOpByName)
|
||||
v1.GET("/can-do-op-by-token", login(), canDoOpByToken)
|
||||
|
||||
v1.GET("/get-user-by-name", login(), getUserByName)
|
||||
}
|
||||
|
||||
push := r.Group("/v1/n9e/series").Use(gzip.Gzip(gzip.DefaultCompression))
|
||||
|
|
|
@ -90,3 +90,8 @@ func canDoOpByToken(c *gin.Context) {
|
|||
can, err := user.CanDo(queryStr(c, "op"))
|
||||
renderData(c, can, err)
|
||||
}
|
||||
|
||||
func getUserByName(c *gin.Context) {
|
||||
user, err := models.UserGetByUsername(queryStr(c, "name"))
|
||||
renderData(c, user, err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue