Files
plates-server/test-goal-tasks.http
richarjiang 3530d123fc feat: 新增目标子任务管理功能模块
- 实现目标子任务的完整功能,包括数据库表设计、API接口、业务逻辑和文档说明。
- 支持用户创建、管理和跟踪目标子任务,提供增删改查操作及任务完成记录功能。
- 引入惰性任务生成机制,优化任务管理体验,提升系统性能和用户交互。
2025-08-22 16:01:12 +08:00

186 lines
4.6 KiB
HTTP
Raw 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.

### API
@baseUrl = http://localhost:3000
@token = your-auth-token-here
### 1.
POST {{baseUrl}}/goals
Authorization: Bearer {{token}}
Content-Type: application/json
{
"title": "",
"description": "8",
"repeatType": "daily",
"frequency": 8,
"category": "",
"startDate": "2024-01-01",
"hasReminder": true,
"reminderTime": "09:00"
}
### 2.
POST {{baseUrl}}/goals
Authorization: Bearer {{token}}
Content-Type: application/json
{
"title": "",
"description": "330",
"repeatType": "weekly",
"frequency": 3,
"category": "",
"startDate": "2024-01-01",
"targetCount": 52
}
### 3.
POST {{baseUrl}}/goals
Authorization: Bearer {{token}}
Content-Type: application/json
{
"title": "",
"description": "1",
"repeatType": "custom",
"frequency": 1,
"customRepeatRule": {
"weekdays": [0, 6]
},
"category": "",
"startDate": "2024-01-01"
}
### 4.
GET {{baseUrl}}/goals?page=1&pageSize=10
Authorization: Bearer {{token}}
### 5.
GET {{baseUrl}}/goals/tasks?page=1&pageSize=20
Authorization: Bearer {{token}}
### 6.
GET {{baseUrl}}/goals/tasks?startDate=2024-01-15&endDate=2024-01-15
Authorization: Bearer {{token}}
### 7.
GET {{baseUrl}}/goals/tasks?status=pending
Authorization: Bearer {{token}}
### 8.
# goalId
GET {{baseUrl}}/goals/{goalId}/tasks
Authorization: Bearer {{token}}
### 9. -
# taskId
POST {{baseUrl}}/goals/tasks/{taskId}/complete
Authorization: Bearer {{token}}
Content-Type: application/json
{
"count": 1,
"notes": ""
}
### 10. -
# taskId
POST {{baseUrl}}/goals/tasks/{taskId}/complete
Authorization: Bearer {{token}}
Content-Type: application/json
{
"count": 3,
"notes": "3",
"completedAt": "2024-01-15T14:30:00Z"
}
### 11.
# taskId
GET {{baseUrl}}/goals/tasks/{taskId}
Authorization: Bearer {{token}}
### 12.
# taskId
PUT {{baseUrl}}/goals/tasks/{taskId}
Authorization: Bearer {{token}}
Content-Type: application/json
{
"notes": "",
"targetCount": 10
}
### 13.
# taskId
POST {{baseUrl}}/goals/tasks/{taskId}/skip
Authorization: Bearer {{token}}
Content-Type: application/json
{
"reason": ""
}
### 14.
GET {{baseUrl}}/goals/tasks/stats/overview
Authorization: Bearer {{token}}
### 15.
# goalId
GET {{baseUrl}}/goals/tasks/stats/overview?goalId={goalId}
Authorization: Bearer {{token}}
### 16.
# goalId
GET {{baseUrl}}/goals/{goalId}
Authorization: Bearer {{token}}
### 17.
POST {{baseUrl}}/goals/batch
Authorization: Bearer {{token}}
Content-Type: application/json
{
"goalIds": ["goal-id-1", "goal-id-2"],
"action": "pause"
}
### 18.
GET {{baseUrl}}/goals/tasks?status=overdue
Authorization: Bearer {{token}}
### 19.
GET {{baseUrl}}/goals/tasks?status=completed&page=1&pageSize=10
Authorization: Bearer {{token}}
### 20.
GET {{baseUrl}}/goals/tasks?startDate=2024-01-08&endDate=2024-01-14
Authorization: Bearer {{token}}
###
# 1
# 1. 1
# 2. 4
# 3. 6
# 4. 910
# 5. 14
# 2
# 1. 2
# 2. 20
# 3. 9
# 4. 8
# 3
# 1. 7
# 2. 13
# 3. 12
# 4. 18
###
# 1. {goalId} {taskId} ID
# 2. {{token}}
# 3.
# 4. API