Skip to content

Commit a923025

Browse files
authored
douyin-webapp (#1)
* update bilibili webapp * update readme * update douyin webapp userdata
1 parent 55c52e2 commit a923025

File tree

8 files changed

+311
-119
lines changed

8 files changed

+311
-119
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
.vscode
3+
.DS_Store

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# protocol
22
国内各大公司开放平台协议文件,存放protobuf文件
33

4-
- [ ]dyma [抖音小程序开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/server-api-introduction)
5-
- [ ]dywa [抖音移动/网站应用开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/list)
6-
- [ ]wxmp [微信小程序开放平台接口](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/)
4+
- [x] bilibili-webapp [B站移动/网站应用开放平台接口](https://openhome.bilibili.com/doc)
5+
- [ ] douyin-miniapp [抖音小程序开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/server-api-introduction)
6+
- [ ] douyin-webapp [抖音移动/网站应用开放平台接口](https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/list)
7+
- [ ] wx-miniprogram [微信小程序开放平台接口](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/)

douyin-webapp/account.proto

Lines changed: 50 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,51 @@
1-
// 抖音移动/网站应用接口 douyin-webapp
2-
3-
syntax = "proto3";
4-
package open.douyin.com ;
5-
import "google/api/annotations.proto";
6-
import "douyin-webapp/extra.proto";
7-
8-
option go_package = "github.com/dev-openapi/douyin-webapp";
9-
10-
service AccountService {
11-
// 获取用户公开信息 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-management/get-account-open-info
12-
rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoRes) {
13-
option (google.api.http) = {
14-
post: "/oauth/userinfo",
15-
body: "*,form"
16-
};
17-
};
18-
// 粉丝判断 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-management/fans-judge
19-
rpc FansCheck(FansCheckReq) returns (FansCheckRes) {
20-
option (google.api.http) = {
21-
post: "/fans/check",
22-
body: "*"
23-
};
24-
}
25-
}
26-
27-
message GetUserInfoReq {
28-
string access_token = 1;
29-
string open_id = 2;
30-
}
31-
32-
message UserInfo {
33-
string avatar = 1;
34-
string nickname = 2;
35-
string open_id = 5;
36-
string description = 6;
37-
string e_account_role = 7;
38-
int32 error_code = 8;
39-
string union_id = 9;
40-
string encrypt_mobile = 100; // 加密手机号,需要解密
41-
}
42-
43-
message GetUserInfoRes {
44-
string message = 1;
45-
UserInfo data = 2;
46-
}
47-
48-
message FansCheckReq {
49-
string follower_open_id = 1;
50-
string open_id = 2;
51-
}
52-
53-
message FansCheckRes {
54-
message Data {
55-
bool is_follower = 1;
56-
int64 follow_time = 2;
57-
}
58-
Extra extra = 1;
59-
Data data =2;
1+
// 抖音移动/网站应用接口 - 用户管理
2+
3+
syntax = "proto3";
4+
package open.douyin.com ;
5+
import "google/api/annotations.proto";
6+
import "douyin-webapp/common.proto";
7+
8+
option go_package = "github.com/dev-openapi/douyin-webapp";
9+
10+
service AccountService {
11+
// 获取用户公开信息
12+
rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoRes) {
13+
option (google.api.http) = {
14+
post: "/oauth/userinfo/",
15+
body: "*,form",
16+
};
17+
}
18+
// 粉丝判断 header放access-token
19+
rpc CheckFans(CheckFansReq) returns (CheckFansRes) {
20+
option (google.api.http) = {
21+
get: "/fans/check/",
22+
};
23+
}
24+
}
25+
26+
message GetUserInfoReq {
27+
string access_token = 1;
28+
string open_id = 2;
29+
}
30+
31+
message GetUserInfoRes {
32+
string message = 1;
33+
Extra extra = 2;
34+
UserInfo data = 10;
35+
}
36+
37+
message CheckFansReq {
38+
string follower_open_id = 1;
39+
string open_id = 2;
40+
}
41+
42+
message CheckFansRes {
43+
Extra extra = 1;
44+
message Data {
45+
int64 error_code = 1;
46+
string description = 2;
47+
bool is_follower = 10;
48+
int64 follow_time = 11;
49+
}
50+
Data data = 10;
6051
}

douyin-webapp/common.proto

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// 抖音移动/网站应用接口
2+
3+
syntax = "proto3";
4+
package open.douyin.com ;
5+
import "google/api/annotations.proto";
6+
7+
option go_package = "github.com/dev-openapi/douyin-webapp";
8+
9+
message Extra {
10+
string log_id = 1;
11+
int64 now = 2;
12+
int32 error_code = 3;
13+
string description = 4;
14+
int32 sub_error_code = 5;
15+
string sub_description = 6;
16+
}
17+
18+
message UserInfo {
19+
int64 error_code = 1;
20+
string description = 2;
21+
string avatar = 10;
22+
string nickname = 11;
23+
string open_id = 12;
24+
string e_account_role = 13;
25+
string union_id = 14;
26+
string encrypt_mobile = 15;
27+
}
28+
29+
message VideoStat {
30+
int64 digg_count = 1;
31+
int64 download_count = 2;
32+
int64 play_count = 3;
33+
int64 share_count = 4;
34+
int64 forward_count = 5;
35+
int64 comment_count = 6;
36+
}
37+
38+
message VideoData {
39+
string title = 1;
40+
int64 create_time = 2;
41+
int32 video_status = 3;
42+
string share_url = 4;
43+
string cover = 5;
44+
bool is_top = 6;
45+
string item_id = 7;
46+
bool is_reviewed = 8;
47+
int32 media_type = 9;
48+
VideoStat statistics = 10;
49+
}
50+

douyin-webapp/extra.proto

Lines changed: 0 additions & 16 deletions
This file was deleted.

douyin-webapp/oauth.proto

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// 抖音移动/网站应用接口 douyin-webapp
1+
// 抖音移动/网站应用接口 - 用户授权
22

33
syntax = "proto3";
44
package open.douyin.com ;
55
import "google/api/annotations.proto";
6+
import "douyin-webapp/common.proto";
67

78
option go_package = "github.com/dev-openapi/douyin-webapp";
89

910
service OauthService {
10-
/* 用户授权 */
1111
// 获取 access_token https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-permission/get-access-token
1212
rpc GetAccessToken(GetAccessTokenReq) returns (GetAccessTokenRes) {
1313
option (google.api.http) = {
@@ -39,7 +39,7 @@ service OauthService {
3939
}
4040

4141
message GetAccessTokenReq {
42-
string client_secret = 1; // 应用唯一标识对应的密钥
42+
string client_secret = 1; // 应用唯一标识对应的密钥
4343
string code = 2; // 授权码
4444
string grant_type = 3; // 固定值"authorization_code"
4545
string client_key = 4; // 应用唯一标识
@@ -57,6 +57,7 @@ message GetAccessTokenRes {
5757
string description = 8; // 错误码描述
5858
}
5959
Data data = 2;
60+
Extra extra = 3;
6061
}
6162

6263
message RenewRefreshTokenReq {
@@ -73,6 +74,7 @@ message RenewRefreshTokenRes {
7374
}
7475
string message = 1;
7576
Data data = 2;
77+
Extra extra = 3;
7678
}
7779

7880
message GetClientTokenReq {
@@ -90,6 +92,7 @@ message GetClientTokenRes {
9092
}
9193
string message = 1;
9294
Data data = 2;
95+
Extra extra = 3;
9396
}
9497

9598
message RefreshAccessTokenReq {
@@ -111,4 +114,5 @@ message RefreshAccessTokenRes {
111114
}
112115
string message = 1;
113116
Data data = 2;
117+
Extra extra = 3;
114118
}

0 commit comments

Comments
 (0)