7
0
gaore-common-sdk-go/services/sso/code_auth.go
2020-08-07 16:22:28 +08:00

41 lines
1.1 KiB
Go

package sso
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type CodeAuthRequest struct {
*requests.RpcRequest
OauthCode string `position:"Body" field:"oauthCode" default:"" `
Ident string `position:"Body" field:"ident" default:"" `
}
type CodeAuthResponseData struct {
*requests.RpcRequest
RefreshToken string `json:"refreshToken"`
RefreshTokenExpires int64 `json:"refreshTokenExpires"`
Token string `json:"token"`
TokenExpires int64 `json:"tokenExpires"`
User User `json:"user"`
}
type CodeAuthResponse struct {
*responses.BaseResponse
Data CodeAuthResponseData `json:"data"`
}
func CreateCodeAuthRequest() (req *CodeAuthRequest) {
req = &CodeAuthRequest{RpcRequest: &requests.RpcRequest{}}
req.InitWithApiInfo(HOST, VERSION, "/api/userSess/codeAuth")
req.Method = requests.POST
return
}
func CreateCodeAuthResponse() (response *CodeAuthResponse) {
response = &CodeAuthResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}