server/laf-cloud/dailyTaskDebug.API.md

46 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 每日/周任务调试接口
云函数:`dailyTaskDebug`
仅用于开发和体验环境。部署前配置服务端环境变量 `DAILY_TASK_DEBUG_KEY`;未配置时接口不可用。请求还必须携带当前用户 token,且用户数据中的 `isDebug` 为 `true` 或字符串 `"true"`。
公共请求字段:
```json
{
"uid": "用户ID",
"token": "登录token",
"debugKey": "服务端配置的DAILY_TASK_DEBUG_KEY",
"gameName": "可选,iaa时使用usersAd",
"action": "操作名称"
}
```
## 每日任务操作
- 完成指定任务:`action=complete_daily`,附加 `taskId` 或 `slot`(0~4)。
- 设置指定任务进度:`action=set_daily_progress`,附加 `taskId` 或 `slot`,以及 `value`。
- 完成当天全部任务:`action=complete_all_daily`。任务仍遵守阶段锁定规则,需要依次调用正式领奖接口解锁。
- 重置当天任务:`action=reset_daily`。保留本周星星和周奖励状态。
示例:
```json
{
"uid": "debug-user",
"token": "token",
"debugKey": "secret",
"action": "complete_daily",
"slot": 0
}
```
## 周任务操作
- 设置周星星:`action=set_weekly_stars`,附加 `value`,范围自动限制为 0~140。
- 增加周星星:`action=add_weekly_stars`,附加正数或负数 `value`。
- 重置周任务:`action=reset_weekly`。保留当天任务及进度。
- 重置每日和周任务:`action=reset_all`。
成功响应会返回修改后的完整 `data.task`。测试接口只修改任务数据,不直接发放金币或道具;奖励仍通过正式 `getTaskReward` 接口领取。