fix: 统一分页请求的 offset 语义

This commit is contained in:
zetaloop
2026-04-07 17:56:38 +08:00
parent 424b2b1cca
commit d153b5cf51
46 changed files with 334 additions and 346 deletions
+1 -1
View File
@@ -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