Skip to content

Commit

Permalink
Merge branch 'mergeUser' of github.com:Baihhh/community into mergeUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Baihhh committed Feb 26, 2024
2 parents 942de5d + c8a6f31 commit afd62ed
Show file tree
Hide file tree
Showing 4 changed files with 305 additions and 262 deletions.
53 changes: 26 additions & 27 deletions cmd/gopcomm/community_yap.gox
Original file line number Diff line number Diff line change
Expand Up @@ -264,34 +264,33 @@ get "/delete", ctx => {
}

get "/medias", ctx => {
format := ctx.param("format")
uid := ctx.param("uid")
page := ctx.param("page")
limit := ctx.param("limit")
limitInt, err := strconv.Atoi(limit)
if err != nil {
limitInt = limitConst
}
pageInt, err := strconv.Atoi(page)
if err != nil {
pageInt = 1
}
files, total, err := community.ListMediaByUserId(todo, uid, format, pageInt, limitInt)
if err != nil {
ctx.json {
"code": 0,
"total": total,
"err": err.Error(),
}
} else {
ctx.json {
"code": 200,
"total": total,
"items": files,
}
}
format := ctx.param("format")
uid := ctx.param("uid")
page := ctx.param("page")
pageInt, err := strconv.Atoi(page)
if err != nil {
pageInt = 1
}
limit := ctx.param("limit")
limitInt, err := strconv.Atoi(limit)
if err != nil {
limitInt = limitConst
}
files, count, err := community.ListMediaByUserId(todo, uid, format,pageInt,limitInt)
if err != nil {
ctx.json {
"code": 0,
"total": count,
"err": err.Error(),
}
} else {
ctx.json {
"code": 200,
"total": count,
"items": files,
}
}
}

get "/delMedia", ctx => {
id := ctx.param("id")
token, err := core.GetToken(ctx)
Expand Down
Loading

0 comments on commit afd62ed

Please sign in to comment.