haiwai-common-sdk-go/services/sso/code_auth.go

40 lines
1.0 KiB
Go
Raw Normal View History

2023-02-21 20:46:05 +08:00
package sso
import (
2023-02-21 20:58:53 +08:00
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
2023-02-21 20:46:05 +08:00
)
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
}