ListUser 获取用户列表(管理员使用)
(ctx *gin.Context)
| 327 | |
| 328 | // ListUser 获取用户列表(管理员使用) |
| 329 | func (uh *UserHandler) ListUser(ctx *gin.Context) { |
| 330 | var req req.ListUserReq |
| 331 | if err := ctx.ShouldBindJSON(&req); err != nil { |
| 332 | apiresponse.ErrorWithMessage(ctx, "无效的请求参数") |
| 333 | return |
| 334 | } |
| 335 | |
| 336 | users, err := uh.svc.ListUser(ctx, domain.Pagination{ |
| 337 | Page: req.Page, |
| 338 | Size: req.Size, |
| 339 | }) |
| 340 | if err != nil { |
| 341 | apiresponse.ErrorWithMessage(ctx, UserListError) |
| 342 | return |
| 343 | } |
| 344 | |
| 345 | apiresponse.SuccessWithData(ctx, users) |
| 346 | } |
| 347 | |
| 348 | // GetCodes 获取权限码 |
| 349 | func (uh *UserHandler) GetCodes(ctx *gin.Context) { |
nothing calls this directly
no test coverage detected