chore: rename some request param

This commit is contained in:
Noah Hsu
2022-08-14 23:46:30 +08:00
parent 8cd05275f0
commit 02e2c809a8
6 changed files with 14 additions and 14 deletions

View File

@ -153,7 +153,7 @@ func canAccess(user *model.User, meta *model.Meta, path string, password string)
}
func pagination(objs []model.Obj, req *common.PageReq) (int, []model.Obj) {
pageIndex, pageSize := req.PageIndex, req.PageSize
pageIndex, pageSize := req.Page, req.PerPage
total := len(objs)
start := (pageIndex - 1) * pageSize
if start > total {
@ -190,7 +190,7 @@ func toObjResp(objs []model.Obj) []ObjResp {
return resp
}
type FsGetOrLinkReq struct {
type FsGetReq struct {
Path string `json:"path" form:"path"`
Password string `json:"password" form:"password"`
}
@ -204,7 +204,7 @@ type FsGetResp struct {
}
func FsGet(c *gin.Context) {
var req FsGetOrLinkReq
var req FsGetReq
if err := c.ShouldBind(&req); err != nil {
common.ErrorResp(c, err, 400)
return