schema.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package schema
  2. // RegisterRequestParams 注册请求参数
  3. type RegisterRequestParams struct {
  4. ProductKey string `json:"product_key"`
  5. DeviceCode string `json:"device_code"`
  6. Version string `json:"version"`
  7. }
  8. // Common common response fields
  9. type Common struct {
  10. Code int `json:"code"`
  11. Message string `json:"message"`
  12. }
  13. // RegisterResponse device register response
  14. type RegisterResponse struct {
  15. Common
  16. Data RegisterData `json:"data"`
  17. }
  18. // RegisterData device register response data field
  19. type RegisterData struct {
  20. DeviceId int64 `json:"device_id"`
  21. DeviceSecret string `json:"device_secret"`
  22. DeviceKey string `json:"device_key"`
  23. DeviceIdentifier string `json:"device_identifier"`
  24. }
  25. type LoginResponse struct {
  26. Common
  27. Data DeviceAuthData `json:"data"`
  28. }
  29. // DeviceAuthData device auth response data field
  30. type DeviceAuthData struct {
  31. AccessToken string `json:"access_token"`
  32. AccessAddr string `json:"access_addr"`
  33. }
  34. // AuthRequestParams 验证请求参数
  35. type AuthRequestParams struct {
  36. DeviceId int64 `json:"device_id"`
  37. DeviceSecret string `json:"device_secret"`
  38. Protocol string `json:"protocol"`
  39. }