Skip to content

Commit

Permalink
add service vc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaomingqiang committed Mar 31, 2021
1 parent de062e1 commit 6ac53bd
Show file tree
Hide file tree
Showing 14 changed files with 1,592 additions and 83 deletions.
1 change: 1 addition & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ readCloser, err := tools.DownloadFileToStream(ctx context.Context, url string)
|[图片](https://open.feishu.cn/document/ukTMukTMukTM/uEDO04SM4QjLxgDN)|v4|[service/image](service/image)|[sample/api/image.go](sample/api/image.go)|
|[通讯录](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/introduction)|v3|[service/contact](service/contact)|[sample/api/contact.go](sample/api/contact.go)|
|[日历](https://open.feishu.cn/document/ukTMukTMukTM/uETM3YjLxEzN24SMxcjN)|v4|[service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)|
|[视频会议](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/videoconference/guide)|v1|[service/vc](service/vc)|[sample/api/vc.go](sample/api/vc.go)|
|[云空间文件](https://open.feishu.cn/document/ukTMukTMukTM/uUjM5YjL1ITO24SNykjN)|v1|[service/drive](service/drive)|[sample/api/drive.go](sample/api/drive.go)|

## License
Expand Down
2 changes: 1 addition & 1 deletion sample/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func testSendCardMessage() {
panic(err)
}
body := map[string]interface{}{
"open_id": "[open_id]",
"user_id": "77bbc392",
"msg_type": "interactive",
"card": card,
}
Expand Down
2 changes: 1 addition & 1 deletion sample/api/authen.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func testAccessToken() {
coreCtx := core.WrapContext(ctx)
body := &authen.AuthenAccessTokenReqBody{
GrantType: "authorization_code",
Code: "[code]",
Code: "476Bsaz9mCDIAOmjIOjD4a",
}
reqCall := authenService.Authens.AccessToken(coreCtx, body)

Expand Down
6 changes: 3 additions & 3 deletions sample/api/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
var imageService = image.NewService(configs.TestConfig(constants.DomainFeiShu))

func main() {
testUpload()
//testDownload()
//testUpload()
testDownload()
}

func testUpload() {
Expand Down Expand Up @@ -59,7 +59,7 @@ func testDownload() {
ctx := context.Background()
coreCtx := core.WrapContext(ctx)
reqCall := imageService.Images.Get(coreCtx)
reqCall.SetImageKey("img_dd33673a-0f77-4bde-8ad0-xxxxxxxxx")
reqCall.SetImageKey("img_800c6035-7db8-4844-bc85-01a74d6e5cag")
reqCall.SetResponseStream(f)
_, err = reqCall.Do()
fmt.Println(coreCtx.GetRequestID())
Expand Down
56 changes: 56 additions & 0 deletions sample/api/vc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package main

import (
"context"
"fmt"
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
vc "github.com/larksuite/oapi-sdk-go/service/vc/v1"
)

// for redis store and logrus
// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
var VCService = vc.NewService(configs.TestConfig(constants.DomainFeiShu))

func main() {
testReserveApply()
}

func testReserveApply() {
ctx := context.Background()
coreCtx := core.WrapContext(ctx)
body := &vc.ReserveApplyReqBody{
EndTime: 1617161325,
MeetingSettings: &vc.ReserveMeetingSetting{
Topic: "Test VC",
ActionPermissions: []*vc.ReserveActionPermission{{
Permission: 1,
PermissionCheckers: []*vc.ReservePermissionChecker{{
CheckField: 1,
CheckMode: 1,
CheckList: []string{"77bbc392"},
},
},
},
},
},
}
reqCall := VCService.Reserves.Apply(coreCtx, body, request.SetUserAccessToken("User access token"))
reqCall.SetUserIdType("user_id")
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))
}
72 changes: 36 additions & 36 deletions service/calendar/v4/api.go

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

12 changes: 6 additions & 6 deletions service/calendar/v4/model.go

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

3 changes: 0 additions & 3 deletions service/contact/v3/api.go

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

14 changes: 13 additions & 1 deletion service/contact/v3/model.go

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

62 changes: 31 additions & 31 deletions service/image/v4/api.go

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

13 changes: 12 additions & 1 deletion service/image/v4/model.go

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

Loading

0 comments on commit 6ac53bd

Please sign in to comment.