# 活动模版

## 权限

| Code                        | Kind   | Name             |
| --------------------------- | ------ | ---------------- |
| `activity-template:view`    | menu   | 活动模版查看     |
| `activity-template:create`  | button | 活动模版创建     |
| `activity-template:update`  | button | 活动模版更新     |
| `activity-template:publish` | button | 活动模版发布     |
| `activity-template:delete`  | button | 活动模版归档     |
| `activity-template:data`    | button | 活动模版数据查看 |
| `activity-template:export`  | button | 活动模版数据导出 |
| `activity-template:retry`   | button | 活动模版奖励补发 |

## API 路由

| Method | Path                                                 | Permission                  | Handler                      |
| ------ | ---------------------------------------------------- | --------------------------- | ---------------------------- |
| GET    | `/admin/activities/templates`                        | `activity-template:view`    | ListActivityTemplates        |
| POST   | `/admin/activities/templates`                        | `activity-template:create`  | CreateActivityTemplate       |
| POST   | `/admin/activities/templates/validate`               | `activity-template:create/update/publish` | ValidateActivityTemplate     |
| GET    | `/admin/activities/templates/{template_id}`          | `activity-template:view`    | GetActivityTemplate          |
| PUT    | `/admin/activities/templates/{template_id}`          | `activity-template:update`  | UpdateActivityTemplate       |
| PATCH  | `/admin/activities/templates/{template_id}/status`   | `activity-template:publish` | SetActivityTemplateStatus    |
| DELETE | `/admin/activities/templates/{template_id}`          | `activity-template:delete`  | DeleteActivityTemplate       |
| POST   | `/admin/activities/templates/{template_id}/clone`    | `activity-template:create`  | CloneActivityTemplate        |
| GET    | `/admin/activities/templates/{template_id}/versions` | `activity-template:view`    | ListActivityTemplateVersions |
| GET    | `/admin/activities/templates/{template_id}/data` | `activity-template:data` | GetActivityTemplateData |
| GET    | `/admin/activities/templates/{template_id}/data/export` | `activity-template:export` | ExportActivityTemplateData |
| GET    | `/admin/activities/templates/{template_id}/leaderboard` | `activity-template:data` | ListActivityTemplateLeaderboard |
| GET    | `/admin/activities/templates/{template_id}/rewards` | `activity-template:data` | ListActivityTemplateRewardJobs |
| POST   | `/admin/activities/templates/{template_id}/rewards/{reward_job_id}/retry` | `activity-template:retry` | RetryActivityTemplateRewardJob |
| GET    | `/admin/activities/templates/{template_id}/task-claims` | `activity-template:data` | ListActivityTemplateTaskClaims |
| POST   | `/admin/activities/templates/{template_id}/task-claims/{claim_id}/retry` | `activity-template:retry` | RetryActivityTemplateTaskClaim |
