Files
likedream/internal/api/v1/cptask_req.go
T
sugarBecomer a6babba00d 🐛 适配新版ui
2026-03-24 19:36:16 +08:00

88 lines
2.9 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"`
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 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:"获取首页概览数据"`
}