35 lines
685 B
Go
35 lines
685 B
Go
package asdk
|
|
|
|
import (
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
)
|
|
|
|
type AuthReq struct {
|
|
*requests.RpcRequest
|
|
}
|
|
|
|
type AuthResp struct {
|
|
*responses.BaseResponse
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
Data struct {
|
|
Uid int64 `json:"uid"`
|
|
UserName string `json:"user_name"`
|
|
} `json:"data"`
|
|
TraceId string `json:"trace_id"`
|
|
}
|
|
|
|
func CreateAuthReq(token string) *AuthReq {
|
|
req := &AuthReq{
|
|
RpcRequest: &requests.RpcRequest{},
|
|
}
|
|
|
|
req.InitWithApiInfo(HOST, VERSION, "/api/auth")
|
|
req.Method = requests.POST
|
|
req.FormParams = map[string]string{
|
|
"token": token,
|
|
}
|
|
return req
|
|
}
|