uint/uint64全部改为uint32
This commit is contained in:
@@ -17,22 +17,22 @@ type CreatePlanRequest struct {
|
||||
Name string `json:"name" validate:"required" example:"猪舍温度控制计划"`
|
||||
Description string `json:"description" example:"根据温度自动调节风扇和加热器"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" validate:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" validate:"omitempty,min=0" example:"10"`
|
||||
ExecuteNum uint32 `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"`
|
||||
SubPlanIDs []uint32 `json:"sub_plan_ids,omitempty" validate:"omitempty,dive"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// PlanResponse 定义计划详情响应的结构体
|
||||
type PlanResponse struct {
|
||||
ID uint `json:"id" example:"1"`
|
||||
ID uint32 `json:"id" example:"1"`
|
||||
Name string `json:"name" example:"猪舍温度控制计划"`
|
||||
Description string `json:"description" example:"根据温度自动调节风扇和加热器"`
|
||||
PlanType models.PlanType `json:"plan_type" example:"自定义任务"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" example:"自动"`
|
||||
Status models.PlanStatus `json:"status" example:"已启用"`
|
||||
ExecuteNum uint `json:"execute_num" example:"10"`
|
||||
ExecuteCount uint `json:"execute_count" example:"0"`
|
||||
ExecuteNum uint32 `json:"execute_num" example:"10"`
|
||||
ExecuteCount uint32 `json:"execute_count" example:"0"`
|
||||
CronExpression string `json:"cron_expression" example:"0 0 6 * * *"`
|
||||
ContentType models.PlanContentType `json:"content_type" example:"任务"`
|
||||
SubPlans []SubPlanResponse `json:"sub_plans,omitempty"`
|
||||
@@ -50,17 +50,17 @@ type UpdatePlanRequest struct {
|
||||
Name string `json:"name" example:"猪舍温度控制计划V2"`
|
||||
Description string `json:"description" example:"更新后的描述"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" validate:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" validate:"omitempty,min=0" example:"10"`
|
||||
ExecuteNum uint32 `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"`
|
||||
SubPlanIDs []uint32 `json:"sub_plan_ids,omitempty" validate:"omitempty,dive"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// SubPlanResponse 定义子计划响应结构体
|
||||
type SubPlanResponse struct {
|
||||
ID uint `json:"id" example:"1"`
|
||||
ParentPlanID uint `json:"parent_plan_id" example:"1"`
|
||||
ChildPlanID uint `json:"child_plan_id" example:"2"`
|
||||
ID uint32 `json:"id" example:"1"`
|
||||
ParentPlanID uint32 `json:"parent_plan_id" example:"1"`
|
||||
ChildPlanID uint32 `json:"child_plan_id" example:"2"`
|
||||
ExecutionOrder int `json:"execution_order" example:"1"`
|
||||
ChildPlan *PlanResponse `json:"child_plan,omitempty"`
|
||||
}
|
||||
@@ -77,7 +77,7 @@ type TaskRequest struct {
|
||||
// TaskResponse 定义任务响应结构体
|
||||
type TaskResponse struct {
|
||||
ID int `json:"id" example:"1"`
|
||||
PlanID uint `json:"plan_id" example:"1"`
|
||||
PlanID uint32 `json:"plan_id" example:"1"`
|
||||
Name string `json:"name" example:"打开风扇"`
|
||||
Description string `json:"description" example:"打开1号风扇"`
|
||||
ExecutionOrder int `json:"execution_order" example:"1"`
|
||||
|
||||
Reference in New Issue
Block a user