74 lines
3.1 KiB
Go
74 lines
3.1 KiB
Go
package request
|
|
|
|
type CarePlan struct {
|
|
Icon string `json:"icon"` // icon信息
|
|
Name string `json:"name"` // 农事名称
|
|
Period int `json:"period"` // 周期
|
|
TargetAction string `json:"targetAction"` // 触动的动作
|
|
}
|
|
type CreateCarePlan struct {
|
|
PlantId string `json:"plantId" binding:"required"`
|
|
Icon string `json:"icon"` // icon信息
|
|
Name string `json:"name"` // 农事名称
|
|
Period int `json:"period"` // 周期
|
|
TargetAction string `json:"targetAction"` // 触动的动作
|
|
}
|
|
type AddPlans struct {
|
|
CarePlan []CreateCarePlan `json:"carePlan"`
|
|
}
|
|
|
|
// CreateMyPlant 创建植物
|
|
type CreateMyPlant struct {
|
|
Name string `json:"name"` // 植物名称
|
|
PlantTime string `json:"plantTime"` // 种植时间
|
|
PotMaterial string `json:"potMaterial"` //花盆材质
|
|
PotSize string `json:"potSize"` // 花盆大小 如直径 20cm × 高度 18cm
|
|
Placement string `json:"placement"` //摆放位置
|
|
Sunlight string `json:"sunlight"` //光照条件如每日12小时
|
|
PlantingMaterial string `json:"plantingMaterial"` //植料(即土的材质)
|
|
OssIds []string `json:"ossIds"` // 图片ids
|
|
CarePlans []*CarePlan `json:"carePlans"` // 养护计划
|
|
}
|
|
|
|
type UpdatePlan struct {
|
|
Id string `json:"id" binding:"required"`
|
|
Icon string `json:"icon"` // icon信息
|
|
Name string `json:"name"` // 农事名称
|
|
Period int `json:"period"` // 周期
|
|
TargetAction string `json:"targetAction"` // 触动的动作
|
|
}
|
|
|
|
// UpdateMyPlant 修改植物
|
|
type UpdateMyPlant struct {
|
|
Id string `json:"id" binding:"required"`
|
|
Name string `json:"name"` // 植物名称
|
|
PotMaterial string `json:"potMaterial"` // 花盆材质
|
|
PotSize string `json:"potSize"` // 花盆大小 如直径 20cm × 高度 18cm
|
|
Placement string `json:"placement"` // 摆放位置
|
|
Sunlight string `json:"sunlight"` // 光照条件如每日12小时
|
|
PlantingMaterial string `json:"plantingMaterial"` // 植料(即土的材质)
|
|
CarePlans []*UpdatePlan `json:"carePlans"`
|
|
}
|
|
|
|
type CompleteTask struct {
|
|
TaskId string `json:"taskId" binding:"required"`
|
|
Remark string `json:"remark"`
|
|
}
|
|
|
|
type CreateGrowthRecord struct {
|
|
PlantId string `json:"plantId" binding:"required"`
|
|
OssIds []string `json:"ossIds"`
|
|
Name string `json:"name"`
|
|
Tag string `json:"tag"`
|
|
Desc string `json:"desc"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
// QuickCare 快捷养护记录(无需预设任务)
|
|
type QuickCare struct {
|
|
PlantId string `json:"plantId" binding:"required"`
|
|
Name string `json:"name" binding:"required"` // 养护名称(如 浇水、施肥、喷雾...)
|
|
Icon string `json:"icon"` // icon JSON(和 CarePlan 的 icon 格式一致)
|
|
Remark string `json:"remark"`
|
|
}
|