Skip to content

Commit

Permalink
delete service calendar
Browse files Browse the repository at this point in the history
modify service authen
  • Loading branch information
zhaomingqiang committed Nov 15, 2020
1 parent 42d8031 commit d6b4867
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 1,007 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ $ go get -u github.com/larksuite/oapi-sdk-go
|--------------|--------------|------|------|
| Authentication | v1 | [service/authen](service/authen) | [sample/api/authen.go](sample/api/authen.go)|
| Image | v4 | [service/image](service/image)|[sample/api/image.go](sample/api/image.go)|
| Calendar | v4 | [service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)|
| contact | v3 | [service/contact](service/contact) | [sample/api/contact.go](sample/api/contact.go) |
| Contact | v3 | [service/contact](service/contact) | [sample/api/contact.go](sample/api/contact.go) |


- Instructions for use(For`No business API SDK is generated`the processing method)
Expand Down
1 change: 0 additions & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ $ go get -u github.com/larksuite/oapi-sdk-go
|--------------|--------------|------|------|
| 身份验证 | v1 | [service/authen](service/authen) | [sample/api/authen.go](sample/api/authen.go)|
| 图片 | v4 | [service/image](service/image)|[sample/api/image.go](sample/api/image.go)|
| 日历 | v4 | [service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)|
| 通讯录 | v3 | [service/contact](service/contact)|[sample/api/contact.go](sample/api/contact.go)|


Expand Down
27 changes: 25 additions & 2 deletions sample/api/authen.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ var authenService = authen.NewService(conf)

func main() {
testAccessToken()
testUserInfo()
//testFlushAccessToken()
//testUserInfo()
}

func testAccessToken() {
ctx := context.Background()
coreCtx := core.WarpContext(ctx)
body := &authen.AccessTokenReqBody{
body := &authen.AuthenAccessTokenReqBody{
GrantType: "authorization_code",
Code: "[code]",
}
Expand All @@ -39,6 +40,28 @@ func testAccessToken() {
fmt.Println(tools.Prettify(result))
}

func testFlushAccessToken() {
ctx := context.Background()
coreCtx := core.WarpContext(ctx)
body := &authen.AuthenRefreshAccessTokenReqBody{
GrantType: "refresh_token",
RefreshToken: "[refresh_token]",
}
reqCall := authenService.Authens.RefreshAccessToken(coreCtx, body)

result, err := reqCall.Do()
fmt.Println(coreCtx.GetRequestID())
fmt.Println(coreCtx.GetHTTPStatusCode())
if err != nil {
fmt.Println(tools.Prettify(err))
e := err.(*response.Error)
fmt.Println(e.Code)
fmt.Println(e.Msg)
return
}
fmt.Println(tools.Prettify(result))
}

func testUserInfo() {
ctx := context.Background()
coreCtx := core.WarpContext(ctx)
Expand Down
49 changes: 0 additions & 49 deletions sample/api/calendar.go

This file was deleted.

78 changes: 40 additions & 38 deletions service/authen/v1/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 33 additions & 33 deletions service/authen/v1/model.go
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
package v1

type AccessTokenReqBody struct {
GrantType string `json:"grant_type"`
Code string `json:"code"`
type AuthenAccessTokenReqBody struct {
GrantType string `json:"grant_type,omitempty"`
Code string `json:"code,omitempty"`
}

type RefreshAccessTokenReqBody struct {
GrantType string `json:"grant_type"`
RefreshToken string `json:"refresh_token"`
type AuthenRefreshAccessTokenReqBody struct {
GrantType string `json:"grant_type,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
}

type AccessTokenResult struct {
AccessToken string `json:"access_token"`
AvatarUrl string `json:"avatar_url"`
AvatarThumb string `json:"avatar_thumb"`
AvatarMiddle string `json:"avatar_middle"`
AvatarBig string `json:"avatar_big"`
ExpiresIn int `json:"expires_in"`
Name string `json:"name"`
EnName string `json:"en_name"`
OpenID string `json:"open_id"`
UnionID string `json:"union_id"`
UserID string `json:"user_id"`
TenantKey string `json:"tenant_key"`
RefreshExpiresIn int `json:"refresh_expires_in"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
type UserAccessTokenInfo struct {
AccessToken string `json:"access_token,omitempty"`
AvatarUrl string `json:"avatar_url,omitempty"`
AvatarThumb string `json:"avatar_thumb,omitempty"`
AvatarMiddle string `json:"avatar_middle,omitempty"`
AvatarBig string `json:"avatar_big,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
Name string `json:"name,omitempty"`
EnName string `json:"en_name,omitempty"`
OpenId string `json:"open_id,omitempty"`
UnionId string `json:"union_id,omitempty"`
UserId string `json:"user_id,omitempty"`
TenantKey string `json:"tenant_key,omitempty"`
RefreshExpiresIn int `json:"refresh_expires_in,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
TokenType string `json:"token_type,omitempty"`
}

type UserInfoResult struct {
Name string `json:"name"`
AvatarUrl string `json:"avatar_url"`
AvatarThumb string `json:"avatar_thumb"`
AvatarMiddle string `json:"avatar_middle"`
AvatarBig string `json:"avatar_big"`
Email string `json:"email"`
OpenID string `json:"open_id"`
UnionID string `json:"union_id"`
UserID string `json:"user_id"`
Mobile string `json:"mobile"`
type UserInfo struct {
Name string `json:"name,omitempty"`
AvatarUrl string `json:"avatar_url,omitempty"`
AvatarThumb string `json:"avatar_thumb,omitempty"`
AvatarMiddle string `json:"avatar_middle,omitempty"`
AvatarBig string `json:"avatar_big,omitempty"`
Email string `json:"email,omitempty"`
OpenId string `json:"open_id,omitempty"`
UnionId string `json:"union_id,omitempty"`
UserId string `json:"user_id,omitempty"`
Mobile string `json:"mobile,omitempty"`
}
Loading

0 comments on commit d6b4867

Please sign in to comment.