Files
likedream/internal/api/v1/cptask_req.go
T
sugarBecomer 261153067c ✨ 后端支持统计返回任务ID + 列表按ID筛选
1. TaskStatisticsV2Item 新增 successTaskIds/failTaskIds/pendingTaskIds 字段
2. GetTaskStatisticsV2 返回每日对应的任务ID列表
3. CpTaskListReq 新增 ids 参数,List 方法支持按ID列表筛选
2026-04-24 12:32:54 +08:00

95 lines
3.2 KiB
Go

package v1
import (
"likedream-goframe/internal/application/cpdaily/task/formtype"
"likedream-goframe/internal/ent/cptask"
"github.com/gogf/gf/v2/frame/g"
)
type GetRecentTasksReq struct {
g.Meta `path:"/task/recent" method:"get" tags:"CpTask" summary:"获取最近任务"`
UserId int64 `json:"userId"`
Type cptask.TaskType `json:"type"`
}
type AddTaskReq struct {
g.Meta `path:"/task" method:"post" tags:"CpTask" summary:"添加任务"`
UserId int64 `json:"userId"`
Type string `json:"type"`
Title string `json:"title"`
}
type CpTaskListReq struct {
g.Meta `path:"/task" method:"get" tags:"CpTask" summary:"获取cp任务列表"`
TaskType cptask.TaskType `json:"type"`
Username string `json:"username"`
TaskStatus cptask.TaskStatus `json:"task_status"`
Ids string `json:"ids"`
Page int `json:"page" d:"1"`
Size int `json:"size" d:"10"`
}
type GetCpTaskFormReq struct {
g.Meta `path:"/task/form/{id}" method:"get" tags:"CpTask" summary:"获取任务表单"`
Id int64 `json:"id"`
}
type PutCpTaskFormReq struct {
g.Meta `path:"/task/form/{id}" method:"put" tags:"CpTask" summary:"更新任务表单"`
Id int64 `json:"id"`
Forms []*formtype.CpTaskFormItem `json:"forms" v:"required#表单信息不能为空"`
}
type GetCpTaskExecuteReq struct {
g.Meta `path:"/task/execute/{id}" method:"get" tags:"CpTask" summary:"执行任务参数"`
Id int64 `json:"id"`
}
type PostCpTaskExecuteReq struct {
g.Meta `path:"/task/execute/{id}" method:"post" tags:"CpTask" summary:"更新执行任务参数"`
Id int64 `json:"id"`
Frequency int `json:"frequency"`
NotificationType cptask.NotificationType `json:"notification_type"`
ExecuteHour int `json:"execute_hour"`
ExecuteMinute int `json:"execute_minute"`
ExecuteDays []int `json:"execute_days"`
}
type UpdateTaskTitleReq struct {
g.Meta `path:"/task/title/{id}" method:"put" tags:"CpTask" summary:"修改任务标题"`
Id int64 `json:"id"`
Title string `json:"title" v:"required#标题不能为空"`
}
type DeleteTaskReq struct {
g.Meta `path:"/task/{id}" method:"delete" tags:"CpTask" summary:"删除任务"`
Id int64 `json:"id"`
}
type ExecuteNowReq struct {
g.Meta `path:"/task/executeNow/{id}" method:"post" tags:"CpTask" summary:"立即执行任务"`
Id int64 `json:"id"`
}
type PauseTaskReq struct {
g.Meta `path:"/task/pause/{id}" method:"post" tags:"CpTask" summary:"暂停任务"`
Id int64 `json:"id"`
}
type FindLocationReq struct {
g.Meta `path:"/task/location" method:"get" tags:"CpTask" summary:"查找地址"`
Address string `json:"address"`
}
type GetTaskStatisticsReq struct {
g.Meta `path:"/task/statistics" method:"get" tags:"CpTask" summary:"获取近七日任务统计数据"`
}
type GetTaskStatisticsV2Req struct {
g.Meta `path:"/task/statisticsV2" method:"get" tags:"CpTask" summary:"获取近七日任务统计数据V2"`
}
type GetDashboardSummaryReq struct {
g.Meta `path:"/task/dashboard" method:"get" tags:"CpTask" summary:"获取首页概览数据"`
}