response.go 841 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. // Common common response fields
  3. type Common struct {
  4. Code int `json:"code"`
  5. Message string `json:"message"`
  6. }
  7. // DeviceRegisterData device register response data field
  8. type DeviceRegisterData struct {
  9. DeviceId int64 `json:"device_id"`
  10. DeviceSecret string `json:"device_secret"`
  11. DeviceKey string `json:"device_key"`
  12. DeviceIdentifier string `json:"device_identifier"`
  13. }
  14. // DeviceRegisterResponse device register response
  15. type DeviceRegisterResponse struct {
  16. Common
  17. Data DeviceRegisterData `json:"data"`
  18. }
  19. // DeviceAuthData device auth response data field
  20. type DeviceAuthData struct {
  21. AccessToken string `json:"access_token"`
  22. AccessAddr string `json:"access_addr"`
  23. }
  24. // DeviceAuthResponse device auth response
  25. type DeviceAuthResponse struct {
  26. Common
  27. Data DeviceAuthData `json:"data"`
  28. }