MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / getUserInfo

Function getUserInfo

login_driver/feishu/feishu.go:176–191  ·  view source on GitHub ↗
(tokenType string, token string)

Source from the content-addressed store, hash-verified

174}
175
176func getUserInfo(tokenType string, token string) (*UserInfoResponse, error) {
177 headers := http.Header{}
178 headers.Set("Content-Type", "application/json")
179 switch tokenType {
180 case "Bearer":
181 headers.Set("Authorization", fmt.Sprintf("Bearer %s", token))
182 }
183 resp, err := SendRequest[UserInfoResponse](getUserInfoUri, http.MethodGet, headers, nil, nil)
184 if err != nil {
185 return nil, fmt.Errorf("failed to get user info: %w", err)
186 }
187 if resp.Code != 0 {
188 return nil, fmt.Errorf("failed to get user info: %s", resp.Msg)
189 }
190 return resp, nil
191}
192
193func (d *Driver) Delete(ctx context.Context, ids ...string) error {
194 return d.accountService.OnRemoveUsers(ctx, ids...)

Callers 1

ThirdLoginMethod · 0.70

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected