完成任务5
This commit is contained in:
@@ -7,20 +7,20 @@ import (
|
||||
|
||||
// ListPlansQuery 定义了获取计划列表时的查询参数
|
||||
type ListPlansQuery struct {
|
||||
PlanType repository.PlanTypeFilter `form:"planType,default=自定义任务"` // 计划类型
|
||||
Page int `form:"page,default=1"` // 页码
|
||||
PageSize int `form:"pageSize,default=10"` // 每页大小
|
||||
PlanType repository.PlanTypeFilter `query:"planType"` // 计划类型
|
||||
Page int `query:"page"` // 页码
|
||||
PageSize int `query:"pageSize"` // 每页大小
|
||||
}
|
||||
|
||||
// CreatePlanRequest 定义创建计划请求的结构体
|
||||
type CreatePlanRequest struct {
|
||||
Name string `json:"name" binding:"required" example:"猪舍温度控制计划"`
|
||||
Name string `json:"name" validate:"required" example:"猪舍温度控制计划"`
|
||||
Description string `json:"description" example:"根据温度自动调节风扇和加热器"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" binding:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" example:"10"`
|
||||
CronExpression string `json:"cron_expression" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" validate:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" validate:"omitempty,min=0" example:"10"`
|
||||
CronExpression string `json:"cron_expression" validate:"omitempty,cron" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty" validate:"omitempty,dive"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// PlanResponse 定义计划详情响应的结构体
|
||||
@@ -49,11 +49,11 @@ type ListPlansResponse struct {
|
||||
type UpdatePlanRequest struct {
|
||||
Name string `json:"name" example:"猪舍温度控制计划V2"`
|
||||
Description string `json:"description" example:"更新后的描述"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" binding:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" example:"10"`
|
||||
CronExpression string `json:"cron_expression" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" validate:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" validate:"omitempty,min=0" example:"10"`
|
||||
CronExpression string `json:"cron_expression" validate:"omitempty,cron" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty" validate:"omitempty,dive"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// SubPlanResponse 定义子计划响应结构体
|
||||
|
||||
Reference in New Issue
Block a user