Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.vscode
.DS_Store
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# protocol
国内各大公司开放平台协议文件,存放protobuf文件

- [ ]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/)
- [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/)
109 changes: 50 additions & 59 deletions douyin-webapp/account.proto
Original file line number Diff line number Diff line change
@@ -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;
}
50 changes: 50 additions & 0 deletions douyin-webapp/common.proto
Original file line number Diff line number Diff line change
@@ -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;
}

16 changes: 0 additions & 16 deletions douyin-webapp/extra.proto

This file was deleted.

10 changes: 7 additions & 3 deletions douyin-webapp/oauth.proto
Original file line number Diff line number Diff line change
@@ -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) = {
Expand Down Expand Up @@ -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; // 应用唯一标识
Expand All @@ -57,6 +57,7 @@ message GetAccessTokenRes {
string description = 8; // 错误码描述
}
Data data = 2;
Extra extra = 3;
}

message RenewRefreshTokenReq {
Expand All @@ -73,6 +74,7 @@ message RenewRefreshTokenRes {
}
string message = 1;
Data data = 2;
Extra extra = 3;
}

message GetClientTokenReq {
Expand All @@ -90,6 +92,7 @@ message GetClientTokenRes {
}
string message = 1;
Data data = 2;
Extra extra = 3;
}

message RefreshAccessTokenReq {
Expand All @@ -111,4 +114,5 @@ message RefreshAccessTokenRes {
}
string message = 1;
Data data = 2;
Extra extra = 3;
}
Loading