feat(list): 订单/通知/组局列表分页,生产 NODE_ENV 切换 production
- 仓储层 getOrders/getOrdersForUser/getActivities/getUserNotifications 支持 LIMIT/OFFSET,新增 countOrders/countOrdersForUser/countActivities/getUserNotificationTotal - 接口支持 page/pageSize/status/keyword/payType/creatorId/category,返回 list/total/hasMore;未传 page 保持旧数组格式,兼容后台与工作台 - 小程序订单/通知/组局三页触底加载,筛选与搜索下推服务端,避免只过滤当前页 - 新增 116 套件/758 用例,全绿;线上实测分页与筛选接口正常
这个提交包含在:
@@ -21,16 +21,16 @@ describe('第十二批读接口数据隔离闸门 (订单 / 我的组局 / 分
|
||||
it('仓储层提供按用户隔离的 getOrdersForUser', () => {
|
||||
expect(repoCode).toContain('async getOrdersForUser(');
|
||||
const start = repoCode.indexOf('async getOrdersForUser(');
|
||||
const block = repoCode.slice(start, start + 1400);
|
||||
const block = repoCode.slice(start, start + 2200);
|
||||
expect(block).toContain('buyer_id = ?');
|
||||
expect(block).toContain('claimed_by = ?');
|
||||
expect(block).toContain('companion_name IN (SELECT name FROM companions');
|
||||
});
|
||||
|
||||
it('订单列表:管理端全量,普通用户仅本人相关', () => {
|
||||
const block = routeBlock("app.get('/api/orders',");
|
||||
const block = routeBlock("app.get('/api/orders',", 1800);
|
||||
expect(block).toContain('isVerifiedAdminRequest(req)');
|
||||
expect(block).toContain('repo.getOrdersForUser(uid)');
|
||||
expect(block).toContain('repo.getOrdersForUser(uid,');
|
||||
expect(block).toContain("'查看订单列表'");
|
||||
});
|
||||
});
|
||||
@@ -50,7 +50,7 @@ describe('第十二批读接口数据隔离闸门 (订单 / 我的组局 / 分
|
||||
describe('3. 小程序端订单列表携带当前用户身份', () => {
|
||||
it('getOrders 必须带上当前用户 id', () => {
|
||||
const start = apiCode.indexOf('export async function getOrders(');
|
||||
const block = apiCode.slice(start, start + 300);
|
||||
const block = apiCode.slice(start, start + 900);
|
||||
expect(block).toContain('/orders?userId=${normalizeUserId()}');
|
||||
});
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户