refactor(utils): 修复密码哈希比较逻辑错误 feat(user): 新增按状态筛选优惠券接口 docs: 添加虚拟发货与任务中心相关文档 fix(wechat): 修正Code2Session上下文传递问题 test: 补充订单折扣与积分转换测试用例 build: 更新配置文件与构建脚本 style: 清理多余的空行与注释
1.4 KiB
1.4 KiB
接口文档:任务中心
管理端 /api/admin/task-center
POST /tasks创建任务GET /tasks任务列表GET /tasks/:id任务详情PUT /tasks/:id修改任务DELETE /tasks/:id删除任务POST /tasks/:id/tiers批量创建/更新档位GET /tasks/:id/tiers档位列表POST /tasks/:id/rewards批量创建/更新奖励映射GET /tasks/:id/rewards奖励列表GET /tasks/:id/progress进度概览与发放统计POST /events/order-paid模拟订单支付事件POST /events/invite-success模拟邀请达成事件
APP端 /api/app/task-center
GET /tasks任务列表与规则说明GET /tasks/:id/progress我的进度与已领奖档位POST /tasks/:id/claim手动领取(如启用),发奖走幂等GET /rewards我的奖励中心(可复用现有接口)
请求/响应示例
GET /tasks响应:
{
"tasks": [
{"id":1,"name":"首日下单","status":1,"start_time":"...","end_time":"..."},
{"id":2,"name":"完成N单阶梯","status":1}
]
}
GET /tasks/:id/progress响应:
{
"task_id":2,
"metrics":{"order_count":3,"invite_count":0,"first_order":true},
"claimed_tiers":[1],
"next_tier":{"threshold":5}
}
管理端事件模拟:
POST /events/order-paid
{"user_id":1001,"order_id":90001}
POST /events/invite-success
{"inviter_id":1001,"invitee_id":2002}