schema.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package schema
  2. type SetPowerReq struct {
  3. Power int `json:"power" v:"required|in:1,2"` // 1:开机0:关机
  4. }
  5. type SetModeReq struct {
  6. Mode uint16 `json:"mode" v:"required|between:0,4"` // 模式(0:制冷1:制热 2:除湿 3:送风 4:加湿)
  7. }
  8. type SetNewFanReq struct {
  9. Mode uint16 `json:"mode" v:"required|between:1,2"` // 新风阀模式(1通风模式 2新风模式)
  10. }
  11. type SetSleepModeReq struct {
  12. Mode uint16 `json:"mode" v:"required|between:0,3"` // 睡眠模式(0:无睡眠 1:睡眠1 2:睡眠2 3:睡眠3)
  13. }
  14. type FanSpeedReq struct {
  15. Speed uint16 `json:"temp" v:"required|between:0,6"` // 风速设置((0:自动; 1:1档; 2:2 档; 3: 3 档; 4:4 档; 5: 5 档; 6:超强档;))
  16. }
  17. type FanValveReq struct {
  18. FanValve string `json:"fan_valve" v:"required"`
  19. Value uint16 `json:"value" v:"required|between:0,90"` // 风阀开度设置(0-90)
  20. }
  21. type SetTempReq struct {
  22. Temp uint16 `json:"temp" v:"required|between:16,30"` // 温度值(16-30)
  23. }
  24. type SetValvePowerReq struct {
  25. Valve1 uint16 `json:"valve1"`
  26. Valve2 uint16 `json:"valve2"`
  27. Valve3 uint16 `json:"valve3"`
  28. Valve4 uint16 `json:"valve4"`
  29. Valve5 uint16 `json:"valve5"`
  30. }
  31. type StatusResponse struct {
  32. Power int `json:"power"` // 开机关状态
  33. Mode uint16 `json:"mode"` // 设置模式
  34. NewFan uint16 `json:"new_fan"` // 新风开关
  35. FanSpeed uint16 `json:"fan_speed"` // 设定风速
  36. SetTemp uint16 `json:"set_temp"` // 设置温度
  37. Temperature uint16 `json:"temperature"` // 温度
  38. Humidity uint16 `json:"humidity"` // 湿度
  39. AirQuality uint16 `json:"air_quality"` // pm25
  40. CO2 uint16 `json:"co2"` // co2
  41. FanGateOne int `json:"fan_gate_one"` // 风阀1 状态
  42. FanGateTwo int `json:"fan_gate_two"` // 风阀2 状态
  43. FanGateThree int `json:"fan_gate_three"` // 风阀3 状态
  44. FanGateFour int `json:"fan_gate_four"` // 风阀4 状态
  45. FanGateFive int `json:"fan_gate_five"` // 风阀5 状态
  46. FanGateOneLevel uint16 `json:"fan_gate_one_level"` // 风阀1 开度
  47. FanGateTwoLevel uint16 `json:"fan_gate_two_level"` // 风阀2 开度
  48. FanGateThreeLevel uint16 `json:"fan_gate_three_level"` // 风阀3 开度
  49. FanGateFourLevel uint16 `json:"fan_gate_four_level"` // 风阀4 开度
  50. FanGateFiveLevel uint16 `json:"fan_gate_five_level"` // 风阀5 开度
  51. }