You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.1 KiB

3 years ago
3 years ago
  1. package mill
  2. import "time"
  3. const accountEndpoint = "https://eurouter.ablecloud.cn:9005/zc-account/v1/"
  4. const serviceEndpoint = "https://eurouter.ablecloud.cn:9005/millService/v1/"
  5. type millHome struct {
  6. HomeID int64 `json:"homeId"`
  7. HomeName string `json:"homeName"`
  8. }
  9. type millDevice struct {
  10. DeviceID int `json:"deviceId"`
  11. DeviceName string `json:"deviceName"`
  12. PowerStatus int `json:"powerStatus"`
  13. HolidayTemp int `json:"holidayTemp"`
  14. CurrentTemp float64 `json:"currentTemp"`
  15. SubDomainID int `json:"subDomainId"`
  16. }
  17. type authReqBody struct {
  18. Account string `json:"account"`
  19. Password string `json:"password"`
  20. }
  21. type authResBody struct {
  22. Token string `json:"token"`
  23. UserID int `json:"userId"`
  24. NickName string `json:"nickName"`
  25. TokenExpire string `json:"tokenExpire"`
  26. }
  27. type listHomeReqBody struct{}
  28. type listHomeResBody struct {
  29. HomeList []millHome `json:"homeList"`
  30. }
  31. type listDeviceReqBody struct {
  32. HomeID int64 `json:"homeId"`
  33. }
  34. type listDeviceResBody struct {
  35. DeviceInfo []millDevice `json:"deviceInfo"`
  36. }
  37. type changeInfoReqBody struct {
  38. HomeType int `json:"homeType"`
  39. DeviceID int `json:"deviceId"`
  40. Value int `json:"value"`
  41. TimeZoneNum string `json:"timeZoneNum"`
  42. Key string `json:"key"`
  43. }
  44. type deviceControlReqBody struct {
  45. SubDomain string `json:"subDomain"`
  46. DeviceID int `json:"deviceId"`
  47. TestStatus int `json:"testStatus"`
  48. Operation int `json:"operation"`
  49. Status int `json:"status"`
  50. WindStatus int `json:"windStatus"`
  51. TempType int `json:"tempType"`
  52. PowerLevel int `json:"powerLevel"`
  53. }
  54. type deviceControlGen3Body struct {
  55. Operation string `json:"operation"`
  56. Status int `json:"status"`
  57. SubDomain int `json:"subDomain"`
  58. DeviceId int `json:"deviceId"`
  59. HoldTemp int `json:"holdTemp,omitempty"`
  60. }
  61. type wifiSetTemperatureBody struct {
  62. Type string `json:"type"`
  63. Value int `json:"value"`
  64. }
  65. var location *time.Location
  66. func init() {
  67. myLocation, err := time.LoadLocation("Europe/Oslo")
  68. if err != nil {
  69. panic(err.Error())
  70. }
  71. location = myLocation
  72. }