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

Function list

server/handles/sshkey.go:111–127  ·  view source on GitHub ↗
(c *gin.Context, userObj *model.User)

Source from the content-addressed store, hash-verified

109}
110
111func list(c *gin.Context, userObj *model.User) {
112 var req model.PageReq
113 if err := c.ShouldBind(&req); err != nil {
114 common.ErrorResp(c, err, 400)
115 return
116 }
117 req.Validate()
118 keys, total, err := op.GetSSHPublicKeyByUserId(userObj.ID, req.Page, req.PerPage)
119 if err != nil {
120 common.ErrorResp(c, err, 500, true)
121 return
122 }
123 common.SuccessResp(c, common.PageResp{
124 Content: keys,
125 Total: total,
126 })
127}

Callers 2

ListMyPublicKeyFunction · 0.70
ListPublicKeysFunction · 0.70

Calls 4

ValidateMethod · 0.95
ErrorRespFunction · 0.92
GetSSHPublicKeyByUserIdFunction · 0.92
SuccessRespFunction · 0.92

Tested by

no test coverage detected