Updata:增加分页

This commit is contained in:
jiaji.H 2025-12-01 13:30:53 +08:00
parent b1d3fbabf4
commit 28ac17d51a

View File

@ -40,6 +40,8 @@ func List(ctx *gin.Context) {
path := ctx.DefaultQuery("path", "/")
sortBy := ctx.DefaultQuery("sortBy", "name")
sortAsc, _ := strconv.ParseBool(ctx.DefaultQuery("sortAsc", "true"))
page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1"))
pageSize, _ := strconv.Atoi(ctx.DefaultQuery("pageSize", "100"))
resp, err := service.FilesProvider.List(ctx, &files.FileListReq{
Path: path,
UserSpacePath: getUserSpacePath(ctx),
@ -47,6 +49,8 @@ func List(ctx *gin.Context) {
By: sortBy,
Asc: sortAsc,
},
Page: int32(page),
PageSize: int32(pageSize),
})
if err != nil {
service.Error(ctx, err)