From 5461a5bbca757d05db6566d852bd09eb5b0adb10 Mon Sep 17 00:00:00 2001 From: xnzone Date: Sun, 23 Jul 2023 00:28:27 -0400 Subject: [PATCH 1/3] update bilibili webapp --- .gitignore | 3 +++ README.md | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff0ed38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +.vscode +.DS_Store diff --git a/README.md b/README.md index 8f6d017..03943a2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # protocol 国内各大公司开放平台协议文件,存放protobuf文件 +- [x]bilibili-webapp [B站移动/网站应用开放平台接口](https://openhome.bilibili.com/doc) - [ ]dyma [抖音小程序开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/server-api-introduction) - [ ]dywa [抖音移动/网站应用开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/list) - [ ]wxmp [微信小程序开放平台接口](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/) \ No newline at end of file From be39552b96aae33a2d655c837656aa13f1f9082d Mon Sep 17 00:00:00 2001 From: xnzone Date: Sun, 23 Jul 2023 12:32:17 +0800 Subject: [PATCH 2/3] update readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 03943a2..4746c08 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # protocol 国内各大公司开放平台协议文件,存放protobuf文件 -- [x]bilibili-webapp [B站移动/网站应用开放平台接口](https://openhome.bilibili.com/doc) -- [ ]dyma [抖音小程序开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/server-api-introduction) -- [ ]dywa [抖音移动/网站应用开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/list) -- [ ]wxmp [微信小程序开放平台接口](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/) \ No newline at end of file +- [x] bilibili-webapp [B站移动/网站应用开放平台接口](https://openhome.bilibili.com/doc) +- [ ] douyin-miniapp [抖音小程序开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/server-api-introduction) +- [ ] douyin-webapp [抖音移动/网站应用开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/list) +- [ ] wx-miniprogram [微信小程序开放平台接口](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/) \ No newline at end of file From 6424ca2d474684187918b872184e20cb6e227d77 Mon Sep 17 00:00:00 2001 From: xnzone Date: Sun, 23 Jul 2023 02:01:09 -0400 Subject: [PATCH 3/3] update douyin webapp userdata --- douyin-webapp/account.proto | 109 +++++++++++----------- douyin-webapp/common.proto | 50 +++++++++++ douyin-webapp/extra.proto | 16 ---- douyin-webapp/oauth.proto | 10 ++- douyin-webapp/userdata.proto | 170 +++++++++++++++++++++++++++++++++++ douyin-webapp/video.proto | 65 ++++++-------- 6 files changed, 304 insertions(+), 116 deletions(-) create mode 100644 douyin-webapp/common.proto delete mode 100644 douyin-webapp/extra.proto create mode 100644 douyin-webapp/userdata.proto diff --git a/douyin-webapp/account.proto b/douyin-webapp/account.proto index 9b8abd5..425d559 100644 --- a/douyin-webapp/account.proto +++ b/douyin-webapp/account.proto @@ -1,60 +1,51 @@ -// 抖音移动/网站应用接口 douyin-webapp - -syntax = "proto3"; -package open.douyin.com ; -import "google/api/annotations.proto"; -import "douyin-webapp/extra.proto"; - -option go_package = "github.com/dev-openapi/douyin-webapp"; - -service AccountService { - // 获取用户公开信息 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-management/get-account-open-info - rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoRes) { - option (google.api.http) = { - post: "/oauth/userinfo", - body: "*,form" - }; - }; - // 粉丝判断 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-management/fans-judge - rpc FansCheck(FansCheckReq) returns (FansCheckRes) { - option (google.api.http) = { - post: "/fans/check", - body: "*" - }; - } -} - -message GetUserInfoReq { - string access_token = 1; - string open_id = 2; -} - -message UserInfo { - string avatar = 1; - string nickname = 2; - string open_id = 5; - string description = 6; - string e_account_role = 7; - int32 error_code = 8; - string union_id = 9; - string encrypt_mobile = 100; // 加密手机号,需要解密 -} - -message GetUserInfoRes { - string message = 1; - UserInfo data = 2; -} - -message FansCheckReq { - string follower_open_id = 1; - string open_id = 2; -} - -message FansCheckRes { - message Data { - bool is_follower = 1; - int64 follow_time = 2; - } - Extra extra = 1; - Data data =2; +// 抖音移动/网站应用接口 - 用户管理 + +syntax = "proto3"; +package open.douyin.com ; +import "google/api/annotations.proto"; +import "douyin-webapp/common.proto"; + +option go_package = "github.com/dev-openapi/douyin-webapp"; + +service AccountService { + // 获取用户公开信息 + rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoRes) { + option (google.api.http) = { + post: "/oauth/userinfo/", + body: "*,form", + }; + } + // 粉丝判断 header放access-token + rpc CheckFans(CheckFansReq) returns (CheckFansRes) { + option (google.api.http) = { + get: "/fans/check/", + }; + } +} + +message GetUserInfoReq { + string access_token = 1; + string open_id = 2; +} + +message GetUserInfoRes { + string message = 1; + Extra extra = 2; + UserInfo data = 10; +} + +message CheckFansReq { + string follower_open_id = 1; + string open_id = 2; +} + +message CheckFansRes { + Extra extra = 1; + message Data { + int64 error_code = 1; + string description = 2; + bool is_follower = 10; + int64 follow_time = 11; + } + Data data = 10; } \ No newline at end of file diff --git a/douyin-webapp/common.proto b/douyin-webapp/common.proto new file mode 100644 index 0000000..b0a8e8a --- /dev/null +++ b/douyin-webapp/common.proto @@ -0,0 +1,50 @@ +// 抖音移动/网站应用接口 + +syntax = "proto3"; +package open.douyin.com ; +import "google/api/annotations.proto"; + +option go_package = "github.com/dev-openapi/douyin-webapp"; + +message Extra { + string log_id = 1; + int64 now = 2; + int32 error_code = 3; + string description = 4; + int32 sub_error_code = 5; + string sub_description = 6; +} + +message UserInfo { + int64 error_code = 1; + string description = 2; + string avatar = 10; + string nickname = 11; + string open_id = 12; + string e_account_role = 13; + string union_id = 14; + string encrypt_mobile = 15; +} + +message VideoStat { + int64 digg_count = 1; + int64 download_count = 2; + int64 play_count = 3; + int64 share_count = 4; + int64 forward_count = 5; + int64 comment_count = 6; +} + +message VideoData { + string title = 1; + int64 create_time = 2; + int32 video_status = 3; + string share_url = 4; + string cover = 5; + bool is_top = 6; + string item_id = 7; + bool is_reviewed = 8; + int32 media_type = 9; + VideoStat statistics = 10; +} + diff --git a/douyin-webapp/extra.proto b/douyin-webapp/extra.proto deleted file mode 100644 index 8aed6ed..0000000 --- a/douyin-webapp/extra.proto +++ /dev/null @@ -1,16 +0,0 @@ -// 抖音移动/网站应用接口 douyin-webapp - -syntax = "proto3"; -package open.douyin.com ; -import "google/api/annotations.proto"; - -option go_package = "github.com/dev-openapi/douyin-webapp"; - -message Extra { - string log_id = 1; - int64 now = 2; - int32 error_code = 3; - string description = 4; - int32 sub_error_code = 5; - string sub_description = 6; -} \ No newline at end of file diff --git a/douyin-webapp/oauth.proto b/douyin-webapp/oauth.proto index 6fff704..1a9a2ac 100644 --- a/douyin-webapp/oauth.proto +++ b/douyin-webapp/oauth.proto @@ -1,13 +1,13 @@ -// 抖音移动/网站应用接口 douyin-webapp +// 抖音移动/网站应用接口 - 用户授权 syntax = "proto3"; package open.douyin.com ; import "google/api/annotations.proto"; +import "douyin-webapp/common.proto"; option go_package = "github.com/dev-openapi/douyin-webapp"; service OauthService { - /* 用户授权 */ // 获取 access_token https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-permission/get-access-token rpc GetAccessToken(GetAccessTokenReq) returns (GetAccessTokenRes) { option (google.api.http) = { @@ -39,7 +39,7 @@ service OauthService { } message GetAccessTokenReq { - string client_secret = 1; // 应用唯一标识对应的密钥 + string client_secret = 1; // 应用唯一标识对应的密钥 string code = 2; // 授权码 string grant_type = 3; // 固定值"authorization_code" string client_key = 4; // 应用唯一标识 @@ -57,6 +57,7 @@ message GetAccessTokenRes { string description = 8; // 错误码描述 } Data data = 2; + Extra extra = 3; } message RenewRefreshTokenReq { @@ -73,6 +74,7 @@ message RenewRefreshTokenRes { } string message = 1; Data data = 2; + Extra extra = 3; } message GetClientTokenReq { @@ -90,6 +92,7 @@ message GetClientTokenRes { } string message = 1; Data data = 2; + Extra extra = 3; } message RefreshAccessTokenReq { @@ -111,4 +114,5 @@ message RefreshAccessTokenRes { } string message = 1; Data data = 2; + Extra extra = 3; } \ No newline at end of file diff --git a/douyin-webapp/userdata.proto b/douyin-webapp/userdata.proto new file mode 100644 index 0000000..dc114cc --- /dev/null +++ b/douyin-webapp/userdata.proto @@ -0,0 +1,170 @@ +// 抖音移动/网站应用接口 - 用户数据 + +syntax = "proto3"; +package open.douyin.com ; +import "google/api/annotations.proto"; +import "douyin-webapp/common.proto"; + +option go_package = "github.com/dev-openapi/douyin-webapp"; + +service UserdataService { + // 获取用户视频情况 header放 access-token + rpc GetItemData(GetItemDataReq) returns (GetItemDataRes) { + option (google.api.http) = { + get: "/data/external/user/item/", + }; + } + // 获取用户粉丝数数 header 放 access-token + rpc GetFansData(GetFansDataReq) returns (GetFansDataRes) { + option (google.api.http) = { + get: "/data/external/user/fans/", + }; + } + // 获取用户点赞数 header 放 access-token + rpc GetLikeData(GetLikeDataReq) returns (GetLikeDataRes) { + option (google.api.http) = { + get: "/data/external/user/like/", + }; + } + // 获取用户评论数 header 放 access-token + rpc GetCommentData(GetCommentDataReq) returns (GetCommentDataRes) { + option (google.api.http) = { + get: "/data/external/user/comment/", + }; + } + // 获取用户分享数 header 放 access-token + rpc GetShareData(GetShareDataReq) returns (GetShareDataRes) { + option (google.api.http) = { + get: "/data/external/user/share/", + }; + } + // 获取用户主页访问数 header 放 access-token + rpc GetProfileData(GetProfileDataReq) returns (GetProfileDataRes) { + option (google.api.http) = { + get: "/data/external/user/profile/", + }; + } +} + +message GetItemDataReq { + string open_id = 1; + int64 date_type = 2; +} + +message UserItemData { + string date = 1; + int64 new_play = 2; + int64 total_issue = 3; + int64 new_issue = 4; +} + +message GetItemDataRes { + Extra extra = 1; + message Data { + int64 error_code = 1; + string description = 2; + repeated UserItemData result_list = 10; + } + Data data = 10; +} + +message GetFansDataReq { + string open_id = 1; + int64 date_type = 2; +} + +message UserFansData { + string date = 1; + int64 total_fans = 2; + int64 new_fans = 3; +} + +message GetFansDataRes { + Extra extra = 1; + message Data { + int64 error_code = 1; + string description = 2; + repeated UserFansData result_list = 10; + } + Data data = 10; +} + +message GetLikeDataReq { + string open_id = 1; + int64 date_type = 2; +} + +message UserLikeData { + string date = 1; + int64 new_like = 2; +} + +message GetLikeDataRes { + Extra extra = 1; + message Data { + int64 error_code = 1; + string description = 2; + repeated UserLikeData result_list = 10; + } + Data data = 10; +} + +message GetCommentDataReq { + string open_id = 1; + int64 date_type = 2; +} + +message UserCommentData { + string date = 1; + int64 new_comment = 2; +} + +message GetCommentDataRes { + Extra extra = 1; + message Data { + int64 error_code = 1; + string description = 2; + repeated UserCommentData result_list = 10; + } + Data data = 10; +} + +message GetShareDataReq { + string open_id = 1; + int64 date_type = 2; +} + +message UserShareData { + string date = 1; + int64 new_share = 2; +} + +message GetShareDataRes { + Extra extra = 1; + message Data { + int64 error_code = 1; + string description = 2; + repeated UserShareData result_list = 10; + } + Data data = 10; +} + +message GetProfileDataReq { + string open_id = 1; + int64 date_type = 2; +} + +message UserProfileData { + string date = 1; + int64 profile_uv = 2; +} + +message GetProfileDataRes { + Extra extra = 1; + message Data { + int64 error_code = 1; + string description = 2; + repeated UserProfileData result_list = 10; + } + Data data = 10; +} \ No newline at end of file diff --git a/douyin-webapp/video.proto b/douyin-webapp/video.proto index 0b05e45..2804864 100644 --- a/douyin-webapp/video.proto +++ b/douyin-webapp/video.proto @@ -1,71 +1,60 @@ -// 抖音移动/网站应用接口 douyin-webapp +// 抖音移动/网站应用接口 - 视频管理 syntax = "proto3"; package open.douyin.com ; import "google/api/annotations.proto"; -import "douyin-webapp/extra.proto"; +import "douyin-webapp/common.proto"; option go_package = "github.com/dev-openapi/douyin-webapp"; - service VideoService { - // 创建图文 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/video-management/douyin/create-image-text/create-image-text - rpc CreateImageText(CreateImageTextReq) returns (CreateImageTextRes) { + // 查询特定视频的视频数据 header放access-token + rpc GetVideoData(GetVideoDataReq) returns (GetVideoDataRes) { option (google.api.http) = { - post: "/api/douyin/v1/video/create_image_text", - body: "body" + post: "/api/douyin/v1/video/video_data/", + body: "body", }; - }; - // 图片上传 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/video-management/douyin/create-image-text/image-upload - rpc UploadImage(UploadImageReq) returns (UploadImageRes) { + } + // 查询授权帐号视频列表 header放access-token + rpc GetVideoList(GetVideoListReq) returns (GetVideoListRes) { option (google.api.http) = { - post: "/api/douyin/v1/video/upload_image", - body: "body,multi" + get: "/api/douyin/v1/video/video_list/", }; } } -message CreateImageTextReq { +message GetVideoDataReq { string open_id = 1; message Body { - repeated string image_list = 1; - string text = 2; - repeated string at_users = 3; - string micro_app_title = 4; - string micro_app_url = 5; - string micro_appi_id = 6; - string poi_id = 7; + repeated string item_ids = 1; + repeated string video_ids = 2; } Body body = 10; } -message CreateImageTextRes { +message GetVideoDataRes { + Extra extra = 1; message Data { - string item_id = 1; - string video_id = 2; + int64 error_code = 1; + string description = 2; + repeated VideoData list = 10; } - Extra extra = 1; - Data data = 2; + Data data = 10; } -message UploadImageReq { +message GetVideoListReq { string open_id = 1; - message Body { - bytes image = 1; - } - Body body = 10; -} - -message Image { - string image_id = 1; - int32 height = 2; - int32 width = 3; + int64 cursor = 2; + int32 count = 3; } -message UploadImageRes { +message GetVideoListRes { Extra extra = 1; message Data { - Image image = 1; + int64 error_code = 1; + string description = 2; + bool has_more = 3; + repeated VideoData list = 10; } Data data = 10; } \ No newline at end of file