MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ListUsers

Function ListUsers

server/handles/user.go:13–30  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

11)
12
13func 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
32func CreateUser(c *gin.Context) {
33 var req model.User

Callers

nothing calls this directly

Calls 4

ValidateMethod · 0.95
ErrorRespFunction · 0.92
GetUsersFunction · 0.92
SuccessRespFunction · 0.92

Tested by

no test coverage detected