(c *gin.Context)
| 11 | ) |
| 12 | |
| 13 | func ListUsers(c *gin.Context) { |
| 14 | var req model.PageReq |
| 15 | if err := c.ShouldBind(&req); err != nil { |
| 16 | common.ErrorResp(c, err, 400) |
| 17 | return |
| 18 | } |
| 19 | req.Validate() |
| 20 | log.Debugf("%+v", req) |
| 21 | users, total, err := op.GetUsers(req.Page, req.PerPage) |
| 22 | if err != nil { |
| 23 | common.ErrorResp(c, err, 500, true) |
| 24 | return |
| 25 | } |
| 26 | common.SuccessResp(c, common.PageResp{ |
| 27 | Content: users, |
| 28 | Total: total, |
| 29 | }) |
| 30 | } |
| 31 | |
| 32 | func CreateUser(c *gin.Context) { |
| 33 | var req model.User |
nothing calls this directly
no test coverage detected