diff --git a/services/sso/client.go b/services/sso/client.go index 8685694..ba01773 100644 --- a/services/sso/client.go +++ b/services/sso/client.go @@ -29,6 +29,12 @@ func (c *Client) RefreshToken(req *RefreshTokenRequest) (response *RefreshTokenR return } +func (c *Client) SearchUser(req *SearchUserRequest) (response *SearchUserResponse, err error) { + response = CreateSearchUserResponse() + err = c.DoAction(req, response) + return +} + func NewClientWithAccessKey(accesskey, secrect, source string) (client *Client, err error) { client = &Client{} err = client.InitWithAccessKey(accesskey, secrect, source) diff --git a/services/sso/code_auth.go b/services/sso/code_auth.go index 20f6147..8080cb1 100644 --- a/services/sso/code_auth.go +++ b/services/sso/code_auth.go @@ -12,7 +12,6 @@ type CodeAuthRequest struct { } type CodeAuthResponseData struct { - *requests.RpcRequest RefreshToken string `json:"refreshToken"` RefreshTokenExpires int64 `json:"refreshTokenExpires"` Token string `json:"token"` diff --git a/services/sso/get_user.go b/services/sso/get_user.go index 3e39826..e69183d 100644 --- a/services/sso/get_user.go +++ b/services/sso/get_user.go @@ -12,7 +12,6 @@ type GetUserInfoRequest struct { } type GetUserInfoResponseData struct { - *requests.RpcRequest User User `json:"user"` } diff --git a/services/sso/refresh_token.go b/services/sso/refresh_token.go index 7877861..bfa0d5c 100644 --- a/services/sso/refresh_token.go +++ b/services/sso/refresh_token.go @@ -12,7 +12,6 @@ type RefreshTokenRequest struct { } type RefreshTokenResponseData struct { - *requests.RpcRequest Token string `json:"token"` TokenExpires int64 `json:"tokenExpires"` User User `json:"user"` diff --git a/services/sso/search_user.go b/services/sso/search_user.go new file mode 100644 index 0000000..07450a1 --- /dev/null +++ b/services/sso/search_user.go @@ -0,0 +1,34 @@ +package sso + +import ( + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +type SearchUserRequest struct { + *requests.RpcRequest + Uid string `position:"Body" field:"uid" default:"" ` +} + +type SearchUserResponseData struct { + User User `json:"user"` +} + +type SearchUserResponse struct { + *responses.BaseResponse + Data SearchUserResponseData `json:"data"` +} + +func CreateSearchUserRequest() (req *SearchUserRequest) { + req = &SearchUserRequest{RpcRequest: &requests.RpcRequest{}} + req.InitWithApiInfo(HOST, VERSION, "/api/user/search") + req.Method = requests.POST + return +} + +func CreateSearchUserResponse() (response *SearchUserResponse) { + response = &SearchUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}