package schema

// RegisterRequestParams 注册请求参数
type RegisterRequestParams struct {
	ProductKey string `json:"product_key"`
	DeviceCode string `json:"device_code"`
	Version    string `json:"version"`
}

// Common common response fields
type Common struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

// RegisterResponse device register response
type RegisterResponse struct {
	Common
	Data RegisterData `json:"data"`
}

// RegisterData device register response data field
type RegisterData struct {
	DeviceId         int64  `json:"device_id"`
	DeviceSecret     string `json:"device_secret"`
	DeviceKey        string `json:"device_key"`
	DeviceIdentifier string `json:"device_identifier"`
}

type LoginResponse struct {
	Common
	Data DeviceAuthData `json:"data"`
}

// DeviceAuthData device auth response data field
type DeviceAuthData struct {
	AccessToken string `json:"access_token"`
	AccessAddr  string `json:"access_addr"`
}

// AuthRequestParams 验证请求参数
type AuthRequestParams struct {
	DeviceId     int64  `json:"device_id"`
	DeviceSecret string `json:"device_secret"`
	Protocol     string `json:"protocol"`
}
