From d985a603085195dd95452f939bdc51b6ac31b28b Mon Sep 17 00:00:00 2001 From: liaokaishan <874998826@qq.com> Date: Mon, 10 Aug 2020 12:09:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/sso/search_user.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 services/sso/search_user.go diff --git a/services/sso/search_user.go b/services/sso/search_user.go new file mode 100644 index 0000000..fdb04b9 --- /dev/null +++ b/services/sso/search_user.go @@ -0,0 +1,35 @@ +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 SearchUserRequestData struct { + *requests.RpcRequest + User User `json:"user"` +} + +type SearchUserResponse struct { + *responses.BaseResponse + Data CodeAuthResponseData `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 +} From 5ebd42daa5ed5083e8dd0bb333b0e89f99df3bd4 Mon Sep 17 00:00:00 2001 From: liaokaishan <874998826@qq.com> Date: Mon, 10 Aug 2020 12:12:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/sso/code_auth.go | 1 - services/sso/get_user.go | 1 - services/sso/refresh_token.go | 1 - services/sso/search_user.go | 5 ++--- 4 files changed, 2 insertions(+), 6 deletions(-) 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 index fdb04b9..07450a1 100644 --- a/services/sso/search_user.go +++ b/services/sso/search_user.go @@ -10,14 +10,13 @@ type SearchUserRequest struct { Uid string `position:"Body" field:"uid" default:"" ` } -type SearchUserRequestData struct { - *requests.RpcRequest +type SearchUserResponseData struct { User User `json:"user"` } type SearchUserResponse struct { *responses.BaseResponse - Data CodeAuthResponseData `json:"data"` + Data SearchUserResponseData `json:"data"` } func CreateSearchUserRequest() (req *SearchUserRequest) { From fd416818994bda83dee9abb65611fe832f8b6c1f Mon Sep 17 00:00:00 2001 From: liaokaishan <874998826@qq.com> Date: Mon, 10 Aug 2020 12:30:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/sso/client.go | 6 ++++++ 1 file changed, 6 insertions(+) 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)