diff --git a/laf-cloud/postman/sign-in.README.md b/laf-cloud/postman/sign-in.README.md new file mode 100644 index 0000000..d8a537b --- /dev/null +++ b/laf-cloud/postman/sign-in.README.md @@ -0,0 +1,26 @@ +# 七日签到 Postman 配置 + +导入 `sign-in.postman_collection.json` 和 `sign-in.postman_environment.json`,选中环境后填写变量: + +| 变量 | 值 | +| --- | --- | +| baseUrl | Laf 应用地址,不带末尾斜杠,如 https://你的APPID.laf.run | +| uid | 主游戏 users 中的测试账号 ID | +| token | 该账号登录 token | +| adminToken | 测试应用环境变量 SIGN_IN_TEST_ADMIN_TOKEN 的值 | +| levelAmount | 设置测试关卡时使用,默认 23 | + +配置中不包含真实账号和密钥。可以复制环境模板分别保存测试与生产环境;生产环境不要填写测试管理密钥。 + +## 使用 + +- 01:活动信息、原领取接口、错误 token 检查,按需手动发送。原领取接口关闭 HTTP 后不能直接调用。 +- 02:inspect、set_level、reset,以及全部 12 种 prepare 场景,按需手动发送。 +- 03:只选择此文件夹使用 Runner 顺序运行一次。覆盖未达标、首次开启、Day 1~7、当天重试、当天已领、过期和完成;准备、调用和验证已配套,断言会检查返回快照、当天凭据、开始时间和实际领取数量。 + +不要直接运行整个 Collection;01、02 是互相独立的手工工具。回归会覆盖同一个测试账号的关卡与签到记录,最后停留在 completed 场景;需要清理时手动发送 02 中的 reset。reset 不会恢复关卡,也不会撤销前端已经发放的资产。 + +所有请求使用 application/x-www-form-urlencoded。活动信息接口会自动领取,但 canClaim、claimedCount、todayClaimed、status 及 rewards[].claimed 返回领取前快照;todayClaim 是实际落库凭据。前端须按 claimId 去重,并根据 todayClaim.rewards 发奖,Postman 本身不会给客户端增加资产。 + +生产环境不发布 signInTestAdmin;测试管理请求及 03 回归文件夹仅用于测试环境。回归不会验证真实跨日等待或极端跨零点并发,日期边界和并发需通过服务端专项测试另行验证。 + diff --git a/laf-cloud/postman/sign-in.postman_collection.json b/laf-cloud/postman/sign-in.postman_collection.json new file mode 100644 index 0000000..879ec0a --- /dev/null +++ b/laf-cloud/postman/sign-in.postman_collection.json @@ -0,0 +1,3339 @@ +{ + "info": { + "name": "七日签到接口与单账号测试", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "description": "以当前服务端接口为准。请选择环境并填写 baseUrl、uid、token、adminToken。全部请求为 POST 表单。03 文件夹可独立用 Collection Runner 顺序执行,反复覆盖同一测试账号签到状态;仅测试环境运行,不会给前端发放实际资产。生产禁止发布测试管理接口。不要直接运行整个 Collection:01 原领奖接口与 02 管理工具为独立手工请求。" + }, + "variable": [ + { + "key": "lastClaimId", + "value": "" + }, + { + "key": "lastStartAt", + "value": "" + } + ], + "item": [ + { + "name": "01 业务接口(手动调用)", + "item": [ + { + "name": "活动信息(自动领取)", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('活动或未达标结果', () => pm.expect(r.data === false || typeof r.data === 'object').to.eql(true));" + ] + } + } + ] + }, + { + "name": "原领取接口(仅公网开放时)", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInClaim", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInClaim" + ] + }, + "description": "兼容旧客户端。生产环境 methods: [] 后此请求应被路由拒绝;signInActivityInfo 内部引用不受影响。成功响应 code=1,已领/过期等为 code=0,不设置固定成功断言。" + } + }, + { + "name": "活动信息:错误 token", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "invalid-token-for-sign-in-test", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "使用已有有效 token 的测试账号;应返回 code=0。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('拒绝错误 token', () => pm.expect(pm.response.json().code).to.eql(0));" + ] + } + } + ] + } + ] + }, + { + "name": "02 测试管理接口(手动调用)", + "item": [ + { + "name": "查看状态(不触发领取)", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "设置关卡", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "set_level", + "type": "text" + }, + { + "key": "levelAmount", + "value": "{{levelAmount}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:未达标", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "locked", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:刚达标", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "eligible", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:Day 1 待领取", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_1_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:Day 2 待领取", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_2_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:Day 3 待领取", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_3_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:Day 4 待领取", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_4_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:Day 5 待领取", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_5_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:Day 6 待领取", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_6_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:Day 7 待领取", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_7_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:当天已领", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "claimed_today", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:已过期", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "expired", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "准备:已完成", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "completed", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + }, + { + "name": "重置签到(清空记录)", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "reset", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + } + } + ] + }, + { + "name": "03 单账号回归(仅测试环境,按顺序运行此文件夹)", + "item": [ + { + "name": "未达标 [locked]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "locked", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('locked'));" + ] + } + } + ] + }, + { + "name": "2. 检查活动状态", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('未达标不展示', () => pm.expect(r.data).to.eql(false));" + ] + } + } + ] + }, + { + "name": "3. 确认未新增记录", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('记录数不变', () => pm.expect(r.data.claimedCount).to.eql(0));" + ] + } + } + ] + } + ] + }, + { + "name": "刚达标 [eligible]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "eligible", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('eligible'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(0); pm.expect(r.data.nextRewardDay).to.eql(1); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 1)); pm.expect(r.data.todayClaim.rewardDay).to.eql(1); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[0].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(1); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.rewards[0].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(1));" + ] + } + } + ] + } + ] + }, + { + "name": "Day 1 待领取 [day_1_ready]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_1_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('day_1_ready'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(0); pm.expect(r.data.nextRewardDay).to.eql(1); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 1)); pm.expect(r.data.todayClaim.rewardDay).to.eql(1); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[0].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(1); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.rewards[0].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(1));" + ] + } + } + ] + } + ] + }, + { + "name": "Day 2 待领取 [day_2_ready]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_2_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('day_2_ready'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(1); pm.expect(r.data.nextRewardDay).to.eql(2); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 2)); pm.expect(r.data.todayClaim.rewardDay).to.eql(2); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[1].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(2); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.rewards[1].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(2));" + ] + } + } + ] + } + ] + }, + { + "name": "Day 3 待领取 [day_3_ready]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_3_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('day_3_ready'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(2); pm.expect(r.data.nextRewardDay).to.eql(3); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 3)); pm.expect(r.data.todayClaim.rewardDay).to.eql(3); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[2].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(3); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.rewards[2].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(3));" + ] + } + } + ] + } + ] + }, + { + "name": "Day 4 待领取 [day_4_ready]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_4_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('day_4_ready'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(3); pm.expect(r.data.nextRewardDay).to.eql(4); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 4)); pm.expect(r.data.todayClaim.rewardDay).to.eql(4); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[3].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(4); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.rewards[3].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(4));" + ] + } + } + ] + } + ] + }, + { + "name": "Day 5 待领取 [day_5_ready]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_5_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('day_5_ready'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(4); pm.expect(r.data.nextRewardDay).to.eql(5); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 5)); pm.expect(r.data.todayClaim.rewardDay).to.eql(5); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[4].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(5); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.rewards[4].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(5));" + ] + } + } + ] + } + ] + }, + { + "name": "Day 6 待领取 [day_6_ready]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_6_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('day_6_ready'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(5); pm.expect(r.data.nextRewardDay).to.eql(6); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 6)); pm.expect(r.data.todayClaim.rewardDay).to.eql(6); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[5].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(6); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.rewards[5].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(6));" + ] + } + } + ] + } + ] + }, + { + "name": "Day 7 待领取 [day_7_ready]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "day_7_ready", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('day_7_ready'));" + ] + } + } + ] + }, + { + "name": "2. 首次请求:领取前快照", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('领取前字段', () => { pm.expect(r.data.canClaim).to.eql(true); pm.expect(r.data.todayClaimed).to.eql(false); pm.expect(r.data.claimedCount).to.eql(6); pm.expect(r.data.nextRewardDay).to.eql(7); pm.expect(r.data.status).to.eql('active'); });", + "pm.test('奖励展示与领取凭据', () => { pm.expect(r.data.rewards).to.have.lengthOf(7); r.data.rewards.forEach(x => pm.expect(x.claimed).to.eql(x.day < 7)); pm.expect(r.data.todayClaim.rewardDay).to.eql(7); pm.expect(r.data.todayClaim.rewards).to.deep.eql(r.data.rewards[6].items); pm.expect(r.data.todayClaim.claimId).to.be.a('string').and.not.empty; });", + "pm.collectionVariables.set('lastClaimId', r.data.todayClaim.claimId);", + "pm.collectionVariables.set('lastStartAt', String(r.data.startAt));" + ] + } + } + ] + }, + { + "name": "3. 当天重试:已领且凭据相同", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('已领取快照', () => { pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.todayClaimed).to.eql(true); pm.expect(r.data.claimedCount).to.eql(7); pm.expect(r.data.nextRewardDay).to.eql(null); pm.expect(r.data.status).to.eql('completed'); pm.expect(r.data.rewards[6].claimed).to.eql(true); });", + "pm.test('凭据及开始时间不变', () => { pm.expect(r.data.todayClaim.claimId).to.eql(pm.collectionVariables.get('lastClaimId')); pm.expect(String(r.data.startAt)).to.eql(pm.collectionVariables.get('lastStartAt')); });" + ] + } + } + ] + }, + { + "name": "4. 检查实际落库数量", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('落库数量正确', () => pm.expect(r.data.claimedCount).to.eql(7));" + ] + } + } + ] + } + ] + }, + { + "name": "当天已领 [claimed_today]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "claimed_today", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('claimed_today'));" + ] + } + } + ] + }, + { + "name": "2. 检查活动状态", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('不新增领取', () => { pm.expect(r.data.status).to.eql('active'); pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.claimedCount).to.eql(1); });", + "pm.test('返回当天凭据', () => pm.expect(r.data.todayClaim.rewardDay).to.eql(1));" + ] + } + } + ] + }, + { + "name": "3. 确认未新增记录", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('记录数不变', () => pm.expect(r.data.claimedCount).to.eql(1));" + ] + } + } + ] + } + ] + }, + { + "name": "已过期 [expired]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "expired", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('expired'));" + ] + } + } + ] + }, + { + "name": "2. 检查活动状态", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('不新增领取', () => { pm.expect(r.data.status).to.eql('expired'); pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.claimedCount).to.eql(0); });", + "pm.test('无当天凭据', () => pm.expect(r.data.todayClaim).to.eql(null));" + ] + } + } + ] + }, + { + "name": "3. 确认未新增记录", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('记录数不变', () => pm.expect(r.data.claimedCount).to.eql(0));" + ] + } + } + ] + } + ] + }, + { + "name": "已完成 [completed]", + "item": [ + { + "name": "1. 准备场景", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "prepare", + "type": "text" + }, + { + "key": "scenario", + "value": "completed", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('准备场景正确', () => pm.expect(r.data.scenario).to.eql('completed'));" + ] + } + } + ] + }, + { + "name": "2. 检查活动状态", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "token", + "value": "{{token}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInActivityInfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInActivityInfo" + ] + }, + "description": "会自动领取,展示字段为领取前快照。实际发奖读取 todayClaim.rewards,按 claimId 去重。同日重试返回同一凭据。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('不新增领取', () => { pm.expect(r.data.status).to.eql('completed'); pm.expect(r.data.canClaim).to.eql(false); pm.expect(r.data.claimedCount).to.eql(7); });", + "pm.test('无当天凭据', () => pm.expect(r.data.todayClaim).to.eql(null));" + ] + } + } + ] + }, + { + "name": "3. 确认未新增记录", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "uid", + "value": "{{uid}}", + "type": "text" + }, + { + "key": "adminToken", + "value": "{{adminToken}}", + "type": "text" + }, + { + "key": "action", + "value": "inspect", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/signInTestAdmin", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "signInTestAdmin" + ] + }, + "description": "仅测试环境。reset/prepare 会清除该账号原有签到记录;set_level/prepare 会修改测试关卡。不会恢复或修改实际资产。" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const r = pm.response.json();", + "pm.test('接口成功', () => pm.expect(r.code).to.eql(1));", + "pm.test('记录数不变', () => pm.expect(r.data.claimedCount).to.eql(7));" + ] + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/laf-cloud/postman/sign-in.postman_environment.json b/laf-cloud/postman/sign-in.postman_environment.json new file mode 100644 index 0000000..84ee302 --- /dev/null +++ b/laf-cloud/postman/sign-in.postman_environment.json @@ -0,0 +1,36 @@ +{ + "name": "七日签到 - 环境模板(填写后使用)", + "values": [ + { + "key": "baseUrl", + "value": "https://.laf.run", + "type": "default", + "enabled": true + }, + { + "key": "uid", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "token", + "value": "", + "type": "secret", + "enabled": true + }, + { + "key": "adminToken", + "value": "", + "type": "secret", + "enabled": true + }, + { + "key": "levelAmount", + "value": "23", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment" +}