package protocol

import "gitlab.fjmaimaimai.com/mmm-go/ability/models"

const  (
	LoginPassPord ="signInPassword"
	LoginSmdcode ="signInCaptcha"
)

type RequestHeader struct {
	TimeStamp string
	Uuid string
	Sign string
	DeviceType string
	AppProject string
	AccessToken string
	Uid int64
}

/*Login */
type LoginRequest struct {
	Phone string `json:"phone" valid:"Required;Mobile"`
	Code string `json:"code"`
	GrantType string `json:"grantType" valid:"Required"`
	PassWord string `json:"password"`
	ClientId string `json:"clientId" valid:"Required"`
}
type LoginResponse struct {
	AuthCode string `json:"authCode"`
}

/*SmsCode*/
type SmsCodeRequest struct {
	Phone string `json:"phone" valid:"Required;Mobile"`
}
type SmsCodeResponse struct {
}

/*UpdateDevice*/
type UpdateDeviceRequest struct {
	ClientId string `json:"clientId" valid:"Required"`
	DeviceToken string `json:"deviceToken"`
}
type UpdateDeviceResponse struct {
}

/*AccessToken */
type AccessTokenRequest struct {
	ClientId string `json:"clientId" valid:"Required"`
	ClientSecret string `json:"clientSecret" valid:"Required"`
	AuthCode string `json:"authCode" valid:"Required"`
}
type AccessTokenResponse struct {
	RefreshToken string `json:"refreshToken"`
	AccessToken string `json:"accessToken"`
	ExpiresIn int `json:"expiresIn"`
}

/*RefreshToken */
type RefreshTokenRequest struct {
	ClientId string `json:"clientId" valid:"Required"`
	ClientSecret string `json:"clientSecret" valid:"Required"`
	RefreshToken string `json:"refreshToken" valid:"Required"`

	Uid int64 `json:"-"`
	LoginType string `json:"-"`
}
type RefreshTokenResponse struct {
	RefreshToken string `json:"refreshToken"`
	AccessToken string `json:"accessToken"`
	ExpiresIn int `json:"expiresIn"`
}

type Access struct {
	Uid int64
	Type string
	AccessToken string
	RefreshToken string
}

/*CheckToken */
type CheckTokenRequest struct {
	Token string
}
type CheckTokenResponse struct {
	IsValid bool //true:过期  false:没有过期
	UserInfo *models.UserInfo
}


/*CheckUuid */
type CheckUuidRequest struct {
	Uuid string
}
type CheckUuidResponse struct {
}