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.

77 lines
1.8 KiB

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. var location *time.Location
  55. func init() {
  56. myLocation, err := time.LoadLocation("Europe/Oslo")
  57. if err != nil {
  58. panic(err.Error())
  59. }
  60. location = myLocation
  61. }