MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / ListUser

Method ListUser

internal/api/user.go:329–346  ·  view source on GitHub ↗

ListUser 获取用户列表(管理员使用)

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

327
328// ListUser 获取用户列表(管理员使用)
329func (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 获取权限码
349func (uh *UserHandler) GetCodes(ctx *gin.Context) {

Callers

nothing calls this directly

Calls 3

ErrorWithMessageFunction · 0.92
SuccessWithDataFunction · 0.92
ListUserMethod · 0.65

Tested by

no test coverage detected