fix: 统一管理员认证列表的分页参数为 offset/limit

This commit is contained in:
zetaloop
2026-04-07 17:14:20 +08:00
parent 65787c6583
commit 424b2b1cca
4 changed files with 14 additions and 15 deletions
@@ -36,16 +36,16 @@ func (l *GetVerificationsLogic) GetVerifications(req *types.GetPendingListReq) (
if err != nil {
return nil, err
}
page := req.Page
if page < 1 {
page = 1
offset := req.Offset
if offset < 0 {
offset = 0
}
limit := req.Size
limit := req.Limit
if limit <= 0 {
limit = 20
}
verifications, err := l.svcCtx.UserVerificationsRpc.SearchUserVerifications(l.ctx, &pb.SearchUserVerificationsReq{
Page: page - 1,
Page: offset / limit,
Limit: limit,
Role: req.Role,
Status: req.Status,
+2 -2
View File
@@ -20,8 +20,8 @@ type GetMyVerificationsResp struct {
}
type GetPendingListReq struct {
Page int64 `form:"page,default=1"`
Size int64 `form:"size,default=20"`
Offset int64 `form:"offset,default=0"`
Limit int64 `form:"limit,default=20"`
Role string `form:"role,optional"` // 筛选角色
Status string `form:"status,optional"` // 筛选状态,默认 pending
}