40 lines
1.0 KiB
Go
40 lines
1.0 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 {
|
||
|
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
|
||
|
}
|