fix: 统一管理员认证列表的分页参数为 offset/limit
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user