fix: 统一分页请求的 offset 语义
This commit is contained in:
@@ -51,7 +51,7 @@ func toShopProfile(in *pb.Shops) *types.ShopProfile {
|
||||
|
||||
func getShopByOwnerID(ctx context.Context, rpc shopservice.ShopService, ownerID int64) (*pb.Shops, error) {
|
||||
list, err := rpc.SearchShops(ctx, &pb.SearchShopsReq{
|
||||
Page: 0,
|
||||
Offset: 0,
|
||||
Limit: 1,
|
||||
OwnerId: ownerID,
|
||||
})
|
||||
|
||||
@@ -35,8 +35,8 @@ func (l *ListShopsLogic) ListShops(req *types.PageReq) (resp *types.ShopListResp
|
||||
}
|
||||
|
||||
result, err := l.svcCtx.ShopRpc.SearchShops(l.ctx, &pb.SearchShopsReq{
|
||||
Page: req.Offset / req.Limit,
|
||||
Limit: req.Limit,
|
||||
Offset: req.Offset,
|
||||
Limit: req.Limit,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user