-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharticle.proto
197 lines (178 loc) · 4.78 KB
/
article.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// B站开放接口 - 专栏稿件管理 bilibili-webapp
syntax = "proto3";
package member.bilibili.com ;
import "google/api/annotations.proto";
import "bilibili-webapp/common.proto";
option go_package = "github.com/dev-openapi/bilibili-webapp";
service ArticleService {
// 文章提交 https://openhome.bilibili.com/doc/4/b14b77b6-8889-8c8b-2e83-17c5a4c550fb
rpc AddArticle(AddArticleReq) returns (AddArticleRes) {
option (google.api.http) = {
post: "/arcopen/fn/article/add",
body: "body,form",
};
}
// 文章编辑 https://openhome.bilibili.com/doc/4/2b5284bd-9a40-247b-8da6-0ef7cd00afd3
rpc EditArticle(EditArticleReq) returns (EditArticleRes) {
option (google.api.http) = {
post: "/arcopen/fn/article/edit",
body: "body,form"
};
}
// 文章删除 https://openhome.bilibili.com/doc/4/b63f8918-2add-0fbb-0718-d0537329ed1c
rpc DeleteArticle(DeleteArticleReq) returns (DeleteArticleRes) {
option (google.api.http) = {
post: "/arcopen/fn/article/delete",
body: "body,form"
};
}
// 查看文章详情 https://openhome.bilibili.com/doc/4/243457f6-9d44-9348-06ef-366cdbb44eb4
rpc GetArticleDetail(GetArticleDetailReq) returns (GetArticleDetailRes) {
option (google.api.http) = {
get: "/arcopen/fn/article/detail",
body: "body,form",
};
}
// 查询文章列表 https://openhome.bilibili.com/doc/4/c8057666-2b92-fc72-3607-f4199933dc13
rpc BatchGetArticles(BatchGetArticlesReq) returns (BatchGetArticlesRes) {
option (google.api.http) = {
get: "/arcopen/fn/article/list",
body: "body,form",
};
}
// 获取文章的分类列表 https://openhome.bilibili.com/doc/4/120b97a6-24a1-4e9f-47b7-9a201196e5d3
rpc GetArticleCategories(GetArticleCategoriesReq) returns (GetArticleCategoriesRes) {
option (google.api.http) = {
get: "/arcopen/fn/article/categories",
};
}
// 获取视频、文章卡片信息 https://openhome.bilibili.com/doc/4/225be808-a81a-cd82-7703-1bbd601e243d
rpc GetArticleCard(GetArticleCardReq) returns (GetArticleCardRes) {
option (google.api.http) = {
get: "/arcopen/fn/article/card",
body: "body,form",
};
}
}
message Article {
int64 id = 1;
string title = 2;
int32 category = 3;
int32 template_id = 4;
string summary = 5;
string content = 6;
string banner_url = 7;
int32 original = 8;
string image_urls = 9;
string tags = 10;
int64 list_id = 11;
int32 up_closed_reply = 12;
string top_video_bvid = 13;
}
message AddArticleReq {
string client_id = 1;
string access_token = 2;
Article body = 3;
}
message AddArticleRes {
int32 code = 1;
string message = 2;
int32 ttl = 3;
message Data {
int64 id = 1;
}
Data data = 4;
}
message EditArticleReq {
string client_id = 1;
string access_token = 2;
Article body = 3;
}
message EditArticleRes {
int32 code = 1;
string message = 2;
int32 ttl = 3;
}
message DeleteArticleReq {
string client_id = 1;
string access_token = 2;
message Body {
string ids = 1;
}
Body body = 10;
}
message DeleteArticleRes {
int32 code = 1;
string message = 2;
int32 ttl = 3;
}
message GetArticleDetailReq {
string client_id = 1;
string access_token = 2;
message Body {
int64 id = 1;
}
Body body = 10;
}
message GetArticleDetailRes {
int32 code = 1;
string message = 2;
int32 ttl = 3;
ArticleData data = 10;
}
message BatchGetArticlesReq {
string client_id = 1;
string access_token = 2;
message Body {
int32 pn = 1;
int32 ps = 2;
int32 sort = 3;
int32 group = 4;
int32 category = 5;
}
Body body = 10;
}
message CreationArtsType {
int64 all = 1;
int64 audit = 2;
int64 passed = 3;
int64 notPassed = 4;
}
message BatchGetArticlesRes {
int32 code = 1;
string message = 2;
int32 ttl = 3;
message Data {
Page artPage = 1;
repeated ArticleData articles = 2;
CreationArtsType creationArtsType = 3;
}
Data data = 10;
}
message GetArticleCategoriesReq {
string client_id = 1;
string access_token = 2;
}
message GetArticleCategoriesRes {
int32 code = 1;
string message = 2;
int32 ttl = 3;
repeated ArticleCategory data = 10;
}
message GetArticleCardReq {
string client_id = 1;
string access_token = 2;
message Body {
int64 resource_id = 1;
}
Body body = 10;
}
message GetArticleCardRes {
int32 code = 1;
string message = 2;
int32 ttl = 3;
message Data {
string snippet = 1;
}
Data data = 10;
}