Skip to content

Commit

Permalink
更新平台V1相关接口;增加场景跳转;增加用户经营身份管理;增加嵌入式播放
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangshuai committed Oct 19, 2023
1 parent 98e3ff5 commit e9a541f
Show file tree
Hide file tree
Showing 12 changed files with 523 additions and 90 deletions.
119 changes: 110 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ list, err := manager.FollowingList(douyinGo.FollowingListReq{
})
```

**上传视频到文件服务器** `/video/upload/`
**上传视频到文件服务器** `/api/douyin/v1/video/upload_video/`
```go
rs, err := manager.VideoUpload(douyinGo.VideoUploadReq{
AccessToken: "ACCESS_TOKEN",
Expand All @@ -91,15 +91,15 @@ rs, err := manager.VideoUpload(douyinGo.VideoUploadReq{
})
```

**分片初始化上传** `/video/part/init/`
**分片初始化上传** `/api/douyin/v1/video/init_video_part_upload/`
```go
rs, err := manager.VideoPartUploadInit(douyinGo.VideoPartUploadInitReq{
AccessToken: "ACCESS_TOKEN",
OpenId: "OPEN_ID",
})
```

**分片上传视频** `/video/part/upload/`
**分片上传视频** `/api/douyin/v1/video/upload_video_part/`
```go
rs, err := manager.VideoPartUpload(douyinGo.VideoPartUploadReq{
AccessToken: "ACCESS_TOKEN",
Expand All @@ -111,7 +111,7 @@ rs, err := manager.VideoPartUpload(douyinGo.VideoPartUploadReq{
})
```

**分片完成上传** `/video/part/complete/`
**分片完成上传** `/api/douyin/v1/video/complete_video_part_upload/`
```go
rs, err := manager.VideoUploadPartComplete(douyinGo.VideoUploadPartCompleteReq{
AccessToken: "ACCESS_TOKEN",
Expand All @@ -120,7 +120,7 @@ rs, err := manager.VideoUploadPartComplete(douyinGo.VideoUploadPartCompleteReq{
})
```

**创建抖音视频** `/video/create/`
**创建抖音视频** `/api/douyin/v1/video/create_video/`
```go
rs, err := manager.VideoCreate(douyinGo.VideoCreateReq{
AccessToken: "ACCESS_TOKEN",
Expand All @@ -143,7 +143,7 @@ rs, err := manager.VideoDelete(douyinGo.VideoDeleteReq{
})
```

**上传图片到文件服务器** `/image/upload/`
**上传图片到文件服务器** `/api/douyin/v1/video/upload_image/`
```go
rs, err := manager.ImageUpload(douyinGo.ImageUploadReq{
AccessToken: "ACCESS_TOKEN",
Expand All @@ -152,13 +152,13 @@ rs, err := manager.ImageUpload(douyinGo.ImageUploadReq{
})
```

**发布图片** `/image/create/`
**发布图片** `/api/douyin/v1/video/create_image_text/`
```go
rs, err := manager.ImageCreate(douyinGo.ImageCreateReq{
AccessToken: "ACCESS_TOKEN",
OpenId: "OPEN_ID",
Body: douyinGo.ImageCreateBody{
ImageId: "IMAGE_ID",
ImageList: []string{"IMAGE_ID"},
Text: "TITLE",
},
})
Expand Down Expand Up @@ -229,6 +229,19 @@ rs, err := manager.ItemCommentReply(douyinGo.ItemCommentReplyReq{
})
```

**置顶视频评论** `/item/comment/top/`
```go
rs, err := manager.ItemCommentTop(douyinGo.ItemCommentTopReq{
AccessToken: "ACCESS_TOKEN",
OpenId: "OPEN_ID",
Body: douyinGo.ItemCommentTopBody{
CommentId: "COMMENT_ID",
ItemId: "VIDEO_ID",
Top: true,
},
})
```

**获取用户视频情况** `/data/external/user/item/`
```go
rs, err := manager.DataExternalUserItem(douyinGo.DataExternalUserItemReq{
Expand Down Expand Up @@ -430,7 +443,7 @@ signature := manager.JsConfigSignature(douyinGo.ConfigSignReq{
})
```

**获取用户粉丝数据** `/fans/data/`
**获取用户粉丝数据** `/api/douyin/v1/user/fans_data/`
```go
rs, err := manager.FansData(douyinGo.FansDataReq{
AccessToken: "ACCESS_TOKEN",
Expand Down Expand Up @@ -581,3 +594,91 @@ rs, err := manager.FansCheck(douyinGo.FansCheckReq{
FollowerOpenId: "FOLLOWER_OPEN_ID",
})
```

**用户经营身份管理** `/api/douyin/v1/role/check/`
```go
rs, err := manager.FansCheck(douyinGo.FansCheckReq{
AccessToken: "CLIENT_TOKEN",
OpenId: "OPEN_ID",
DouyinShortId: "DOUYIN_SHORTID",
RoleLabels: "ROLE_LABELS",
})
```

**通过VideoID获取IFrame代码** `/api/douyin/v1/video/get_iframe_by_video/`
```go
rs, err := manager.VideoGetIframeByVideo(douyinGo.VideoGetIframeByVideoReq{
VideoId: "VIDEO_ID",
})
```

**通过ItemID获取IFrame代码** `/api/douyin/v1/video/get_iframe_by_item/`
```go
rs, err := manager.VideoGetIframeByItem(douyinGo.VideoGetIframeByItemReq{
ClientKey: "CLIENT_KEY",
ItemId: "ITEM_ID",
})
```

**获取open_ticket** `/open/getticket/`
```go
rs, err := manager.OpenTicket(douyinGo.OpenTicketReq{
AccessToken: "CLIENT_TOKEN",
})
```

**H5分享跳转链接获取** `/api/douyin/v1/schema/get_share/`
```go
rs, err := manager.SchemaGetShare(douyinGo.SchemaGetShareReq{
AccessToken: "CLIENT_TOKEN",
Body: douyinGo.SchemaGetShareBody{
ClientTicket: "OPEN_TICKET",
ExpireAt: "EXPIRE_AT",
VideoPath: "VIDEO_PATH",
},
})
```

**个人页跳转链接获取** `/api/douyin/v1/schema/get_user_profile/`
```go
rs, err := manager.SchemaGetUserProfile(douyinGo.SchemaGetUserProfileReq{
AccessToken: "CLIENT_TOKEN",
Body: douyinGo.SchemaGetUserProfileBody{
ExpireAt: "EXPIRE_AT",
OpenId: "OPEN_ID",
},
})
```

**个人会话页跳转链接获取** `/api/douyin/v1/schema/get_chat/`
```go
rs, err := manager.SchemaGetChat(douyinGo.SchemaGetChatReq{
AccessToken: "CLIENT_TOKEN",
Body: douyinGo.SchemaGetChatBody{
ExpireAt: "EXPIRE_AT",
OpenId: "OPEN_ID",
},
})
```

**视频详情页跳转链接获取** `/api/douyin/v1/schema/get_item_info/`
```go
rs, err := manager.SchemaGetItemInfo(douyinGo.SchemaGetItemInfoReq{
AccessToken: "CLIENT_TOKEN",
Body: douyinGo.SchemaGetItemInfoBody{
ExpireAt: "EXPIRE_AT",
ItemId: "ITEM_ID",
},
})
```

**直播间跳转链接获取** `/api/douyin/v1/schema/get_live/`
```go
rs, err := manager.SchemaGetLive(douyinGo.SchemaGetLiveReq{
AccessToken: "CLIENT_TOKEN",
Body: douyinGo.SchemaGetLiveBody{
ExpireAt: "EXPIRE_AT",
OpenId: "OPEN_ID",
},
})
```
51 changes: 39 additions & 12 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@ const (
API_OAUTH_CLIENT_ACCESS_TOKEN = "/oauth/client_token/"

// API_VIDEO_LIST 查询授权账号视频数据
API_VIDEO_LIST = "/video/list/"
API_VIDEO_LIST = "/api/douyin/v1/video/video_list/"

// API_VIDEO_UPLOAD 上传视频到文件服务器
API_VIDEO_UPLOAD = "/video/upload/"
API_VIDEO_UPLOAD = "/api/douyin/v1/video/upload_video/"

// API_VIDEO_CREATE 创建抖音视频
API_VIDEO_CREATE = "/api/douyin/v1/video/create_video/"

// API_VIDEO_UPLOAD_PART_INIT 初始化分片上传
API_VIDEO_UPLOAD_PART_INIT = "/video/part/init/"
API_VIDEO_UPLOAD_PART_INIT = "/api/douyin/v1/video/init_video_part_upload/"

// API_VIDEO_UPLOAD_PART_UPLOAD 上传视频分片到文件服务器
API_VIDEO_UPLOAD_PART_UPLOAD = "/video/part/upload/"
API_VIDEO_UPLOAD_PART_UPLOAD = "/api/douyin/v1/video/upload_video_part/"

// API_VIDEO_UPLOAD_PART_COMPLETE 完成上传视频
API_VIDEO_UPLOAD_PART_COMPLETE = "/video/part/complete/"

// API_VIDEO_CREATE 创建抖音视频
API_VIDEO_CREATE = "/video/create/"
API_VIDEO_UPLOAD_PART_COMPLETE = "/api/douyin/v1/video/complete_video_part_upload/"

// API_VIDEO_DELETE 删除授权用户发布的视频
API_VIDEO_DELETE = "/video/delete/"

// API_VIDEO_DATA 查询指定视频数据
API_VIDEO_DATA = "/video/data/"
API_VIDEO_DATA = "/api/douyin/v1/video/video_data/"

// API_VIDEO_SEARCH 关键词视频搜索
API_VIDEO_SEARCH = "/video/search/"
Expand All @@ -61,11 +61,17 @@ const (
// API_VIDEO_SEARCH_COMMENT_REPLY 关键词视频评论回复
API_VIDEO_SEARCH_COMMENT_REPLY = "/video/search/comment/reply/"

// API_VIDEO_GET_IFRAME_BY_VIDEO 通过VideoID获取IFrame代码
API_VIDEO_GET_IFRAME_BY_VIDEO = "/api/douyin/v1/video/get_iframe_by_video/"

// API_VIDEO_GET_IFRAME_BY_ITEM 通过ItemID获取IFrame代码
API_VIDEO_GET_IFRAME_BY_ITEM = "/api/douyin/v1/video/get_iframe_by_item/"

// API_IMAGE_UPLOAD 上传图片到文件服务器
API_IMAGE_UPLOAD = "/image/upload/"
API_IMAGE_UPLOAD = "/api/douyin/v1/video/upload_image/"

// API_IMAGE_CREATE 发布图片
API_IMAGE_CREATE = "/image/create/"
API_IMAGE_CREATE = "/api/douyin/v1/video/create_image_text/"

// API_AWEME_SHARE 获取share-id
API_AWEME_SHARE = "/share-id/"
Expand Down Expand Up @@ -116,11 +122,14 @@ const (
API_FANS_LIST = "/fans/list/"

// API_FANS_DATA 获取用户粉丝数据
API_FANS_DATA = "/fans/data/"
API_FANS_DATA = "/api/douyin/v1/user/fans_data/"

// API_FANS_CHECK 获取粉丝判断
API_FANS_CHECK = "/fans/check/"

// API_ROLE_CHECK 用户经营身份管理
API_ROLE_CHECK = "/api/douyin/v1/role/check/"

// API_DATA_EXTERNAL_FANS_SOURCE 获取用户粉丝来源分布
API_DATA_EXTERNAL_FANS_SOURCE = "/data/extern/fans/source/"

Expand All @@ -142,6 +151,9 @@ const (
// API_ITEM_COMMENT_REPLY 回复视频评论
API_ITEM_COMMENT_REPLY = "/item/comment/reply/"

// API_ITEM_COMMENT_TOP 置顶评论
API_ITEM_COMMENT_TOP = "/item/comment/top/"

// API_EVENT_STATUS_LIST 获取事件订阅状态
API_EVENT_STATUS_LIST = "/event/status/list/"

Expand Down Expand Up @@ -294,4 +306,19 @@ const (

// API_MARKET_SERVICE_USER_PERCHASE_LIST 查询用户的服务购买信息
API_MARKET_SERVICE_USER_PERCHASE_LIST = "/market/service/user/purchase/list/"

// API_SCHEMA_GET_SHARE H5分享跳转链接获取
API_SCHEMA_GET_SHARE = "/api/douyin/v1/schema/get_share/"

// API_SCHEMA_GET_USER_PROFILE 个人页跳转链接获取
API_SCHEMA_GET_USER_PROFILE = "/api/douyin/v1/schema/get_user_profile/"

// API_SCHEMA_GET_CHAT 个人会话页跳转链接获取
API_SCHEMA_GET_CHAT = "/api/douyin/v1/schema/get_chat/"

// API_SCHEMA_GET_ITEM_INFO 视频详情页跳转链接获取
API_SCHEMA_GET_ITEM_INFO = "/api/douyin/v1/schema/get_item_info/"

// API_SCHEMA_GET_LIVE 直播间跳转链接获取
API_SCHEMA_GET_LIVE = "/api/douyin/v1/schema/get_live/"
)
15 changes: 7 additions & 8 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,18 @@ type ImageCreateReq struct {

// ImageCreateBody 发布图片
type ImageCreateBody struct {
PoiId string `json:"poi_id,omitempty"` // 地理位置id
PoiName string `json:"poi_name,omitempty"` // 地理位置名称
Text string `json:"text,omitempty"` // 标题,可以带话题。 如title1#话题1 #话题2 注意:话题审核依旧遵循抖音的审核逻辑,强烈建议第三方谨慎拟定话题名称,避免强导流行为。
MicroAppId string `json:"micro_app_id,omitempty"` // 小程序id
ImageList []string `json:"image_list,omitempty"` // 通过/image/upload/接口得到。
Text string `json:"text,omitempty"` // 视频标题。可以带话题,@用户。 注意:话题审核依旧遵循抖音的审核逻辑,强烈建议第三方谨慎拟定话题名称,避免强导流行为。
AtUsers []string `json:"at_users,omitempty"` // 如果需要at其他用户。将 text 中 @nickname 对应的 open_id 放到这里。
MicroAppTitle string `json:"micro_app_title,omitempty"` // 小程序标题
MicroAppUrl string `json:"micro_app_url,omitempty"` // 吊起小程序时的参数
ImageId string `json:"image_id"` // 通过/image/upload/接口得到。
AtUsers []string `json:"at_users,omitempty"` // 如果需要at其他用户。将text中@nickname对应的open_id放到这里
MicroAppUrl string `json:"micro_app_url,omitempty"` // 开发者在小程序中生成该页面时写的path地址
MicroAppId string `json:"micro_app_id,omitempty"` // 小程序 ID
PoiId string `json:"poi_id,omitempty"` // 地理位置 id,poi_id 可通过"查询 POI 信息"能力获取
}

// ImageCreateResData 发布图片
type ImageCreateResData struct {
ItemId string `json:"item_id"` // 抖音图片id
ItemId string `json:"item_id,omitempty"` // 抖音图片id
DYError
}

Expand Down
Loading

0 comments on commit e9a541f

Please sign in to comment.