fix: 统一分页请求的 offset 语义
This commit is contained in:
@@ -44,7 +44,7 @@ func (l *SearchUserVerificationsLogic) SearchUserVerifications(in *pb.SearchUser
|
||||
}
|
||||
|
||||
verifications, err := l.svcCtx.UserVeriModelRO.Query().Where(predicates...).
|
||||
Offset(int(in.Page * in.Limit)).
|
||||
Offset(int(in.Offset)).
|
||||
Limit(int(in.Limit)).
|
||||
All(l.ctx)
|
||||
if err != nil {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v5.29.6
|
||||
// protoc v7.34.1
|
||||
// source: user_verifications.proto
|
||||
|
||||
package pb
|
||||
@@ -604,7 +604,7 @@ func (x *GetUserVerificationsByIdResp) GetUserVerifications() *UserVerifications
|
||||
|
||||
type SearchUserVerificationsReq struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //page
|
||||
Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` //offset
|
||||
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` //limit
|
||||
Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` //id
|
||||
UserId int64 `protobuf:"varint,4,opt,name=userId,proto3" json:"userId,omitempty"` //userId
|
||||
@@ -650,9 +650,9 @@ func (*SearchUserVerificationsReq) Descriptor() ([]byte, []int) {
|
||||
return file_user_verifications_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *SearchUserVerificationsReq) GetPage() int64 {
|
||||
func (x *SearchUserVerificationsReq) GetOffset() int64 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
return x.Offset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -1035,9 +1035,9 @@ const file_user_verifications_proto_rawDesc = "" +
|
||||
"\x1bGetUserVerificationsByIdReq\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\"c\n" +
|
||||
"\x1cGetUserVerificationsByIdResp\x12C\n" +
|
||||
"\x11userVerifications\x18\x01 \x01(\v2\x15.pb.UserVerificationsR\x11userVerifications\"\xd8\x02\n" +
|
||||
"\x1aSearchUserVerificationsReq\x12\x12\n" +
|
||||
"\x04page\x18\x01 \x01(\x03R\x04page\x12\x14\n" +
|
||||
"\x11userVerifications\x18\x01 \x01(\v2\x15.pb.UserVerificationsR\x11userVerifications\"\xdc\x02\n" +
|
||||
"\x1aSearchUserVerificationsReq\x12\x16\n" +
|
||||
"\x06offset\x18\x01 \x01(\x03R\x06offset\x12\x14\n" +
|
||||
"\x05limit\x18\x02 \x01(\x03R\x05limit\x12\x0e\n" +
|
||||
"\x02id\x18\x03 \x01(\x03R\x02id\x12\x16\n" +
|
||||
"\x06userId\x18\x04 \x01(\x03R\x06userId\x12\x12\n" +
|
||||
|
||||
Reference in New Issue
Block a user