-
Notifications
You must be signed in to change notification settings - Fork 0
/
core_common.proto
408 lines (400 loc) · 9.56 KB
/
core_common.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
syntax="proto3";
option java_package = "com.bootapp.grpc.core";
import "google/protobuf/wrappers.proto";
package proto;
//===================================== Common Types
enum RegisterType {
REGISTER_TYPE_NULL = 0;
REGISTER_TYPE_USERNAME_PASS = 1;
REGISTER_TYPE_PHONE_PASS = 2;
REGISTER_TYPE_EMAIL_PASS = 3;
REGISTER_TYPE_PHONE_CODE = 4;
REGISTER_TYPE_PHONE_PASS_CODE = 5;
REGISTER_TYPE_CIPHER = 6;
}
enum EntityStatus {
ENTITY_STATUS_NULL = 0;
ENTITY_STATUS_NORMAL = 1;
ENTITY_STATUS_DELETED = 2;
ENTITY_STATUS_INACTIVATED = 3;
ENTITY_STATUS_DEPRECATED = 4;
ENTITY_STATUS_SUBMITTED = 5;
ENTITY_STATUS_PROCESSING = 6;
ENTITY_STATUS_DONE = 7;
ENTITY_STATUS_REJECTED = 8;
ENTITY_STATUS_FROZEN = 9;
}
enum Language {
LANG_NULL = 0;
LANG_ZH_CN = 1;
}
enum Country {
COUNTRY_NULL = 0;
COUNTRY_CHINA = 1;
}
enum AuthType {
AUTH_TYPE_NULL = 0;
AUTH_TYPE_READ = 1;
AUTH_TYPE_WRITE = 2;
}
enum UpdateType {
UPDATE_TYPE_NULL = 0;
UPDATE_TYPE_REPLACE = 1;
UPDATE_TYPE_APPEND = 2;
}
enum SortType {
SORT_TYPE_NULL = 0;
SORT_TYPE_TIME_ASC = 1;
SORT_TYPE_TIME_DESC = 2;
SORT_TYPE_ID_ASC = 3;
SORT_TYPE_ID_DESC = 4;
}
enum InfoType {
INFO_TYPE_NULL = 0;
INFO_TYPE_BRIEF = 1;
INFO_TYPE_EXTENT = 2;
INFO_TYPE_DETAIL = 3;
}
message Pagination {
int64 idx = 1; // = page or offset according to specific method
int64 size = 2;
SortType sort = 3;
int64 total = 4;
}
message AuthorizedReq {
int64 user_id = 1;
int64 org_id = 2;
}
message PaginationReq {
Pagination pagination = 1;
}
message AuthorizedPaginationReq {
int64 user_id = 1;
int64 org_id = 2;
Pagination pagination = 3;
}
message IdReq {
int64 id = 1;
}
message IdsReq {
repeated int64 ids = 1;
}
message AuthorizedIdReq {
int64 id = 1;
int64 user_id = 2;
int64 org_id = 3;
}
message PaginatedIdReq {
int64 id = 1;
Pagination pagination = 2;
}
message PaginatedIdsReq {
repeated int64 ids = 1;
Pagination pagination = 2;
}
message AuthorizedIdsReq {
repeated int64 ids = 1;
int64 user_id = 2;
int64 org_id = 3;
}
message StringReq {
string query = 1;
Pagination pagination = 2;
}
message AuthorizedStringReq {
string query = 1;
int64 user_id = 2;
int64 org_id = 3;
Pagination pagination = 4;
}
message Empty {}
message StringsResp {
repeated string data = 1;
}
// =========================================== Auth
message Authority {
string key = 1;
int64 group_id = 2;
int64 value = 3;
string name = 4;
}
message AuthorityEdit {
string key = 1;
int64 group_id = 2;
google.protobuf.Int64Value value = 3;
string name = 4;
}
message AuthoritiesResp {
repeated Authority data = 1;
}
message AuthGroup {
int64 id = 1;
int64 pid = 2;
string name = 3;
}
message AuthGroupEdit {
int64 id = 1;
google.protobuf.Int64Value pid = 2;
string name = 3;
}
message AuthGroupsResp {
repeated AuthGroup data = 1;
}
// =========================================== RoleOrg
message RoleOrg {
int64 id = 1;
string name = 2;
string remark = 3;
string authorities = 4;
}
message RoleOrgEdit {
int64 id = 1;
google.protobuf.StringValue name = 2;
google.protobuf.StringValue remark = 3;
google.protobuf.StringValue authorities = 4;
}
message RoleOrgsResp {
repeated RoleOrg data = 1;
Pagination pagination = 2;
map<int64, AuthGroup> auth_group_map = 3;
}
// =========================================== RoleUser
message RoleUser {
int64 id = 1;
int64 org_id = 2;
string name = 3;
string remark = 4;
string authorities = 5;
}
message RoleUserEdit {
int64 id = 1;
google.protobuf.Int64Value org_id = 2;
google.protobuf.StringValue name = 3;
google.protobuf.StringValue remark = 4;
google.protobuf.StringValue authorities = 5;
}
message RoleUsersResp {
repeated RoleUser data = 1;
Pagination pagination = 2;
map<string, Authority> auth_map = 3;
}
// =========================================== User
message UserEdit {
int64 id = 1;
int64 org_id = 2;
EntityStatus status = 3;
google.protobuf.StringValue phone = 4;
google.protobuf.StringValue email = 5;
google.protobuf.StringValue username = 6;
google.protobuf.StringValue password = 7;
google.protobuf.Int32Value reg_ip = 9;
google.protobuf.Int64Value last_login_time = 10;
google.protobuf.Int32Value last_login_ip = 11;
}
message User {
int64 id = 1;
int64 org_id = 2;
EntityStatus status = 3;
string phone = 4;
string email = 5;
string username = 6;
int64 created_at = 7;
int64 updated_at = 8;
int32 reg_ip = 9;
int64 last_login_time = 10;
int32 last_login_ip = 11;
}
message OrgWithAuthorities {
int64 id = 1;
string name = 2;
string authority_groups =3;
string authorities = 4;
}
message UserWithOrgAuth {
User user = 1;
repeated OrgWithAuthorities org_info = 2;
}
message UserWithOrgInfo {
User user = 1;
repeated Organization orgs = 2;
}
message UsersResp {
repeated User data = 1;
Pagination pagination = 2;
}
// =========================================== Org
message Organization {
int64 id = 1;
string code = 2;
int64 org_role_id = 3;
string name = 4;
EntityStatus status = 5;
int64 created_at = 6;
int64 updated_at = 7;
}
message OrganizationEdit {
int64 id = 1;
google.protobuf.StringValue code = 2;
google.protobuf.Int64Value org_role_id = 3;
google.protobuf.StringValue name = 4;
EntityStatus status = 5;
}
message OrgsResp {
repeated Organization data = 1;
Pagination pagination = 2;
}
// =========================================== Message
enum MessageType {
MESSAGE_TYPE_NULL = 0;
MESSAGE_TYPE_ORG = 1;
MESSAGE_TYPE_USER = 2;
MESSAGE_TYPE_ALL = 3;
}
enum ReceiveType {
RECEIVE_TYPE_NULL = 0;
RECEIVE_TYPE_SITE = 1;
RECEIVE_TYPE_EMAIL = 2; //reserved
RECEIVE_TYPE_SMS = 3; //reserved
}
message MessageEdit {
int64 id = 1;
MessageType type = 2;
ReceiveType receive_type = 3;
int64 org_id = 4;
int64 user_id = 5;
int64 to = 6;
google.protobuf.StringValue title = 7;
google.protobuf.StringValue content = 8;
google.protobuf.StringValue file_urls = 9;
google.protobuf.StringValue img_urls = 10;
EntityStatus status = 11;
}
message Message {
int64 id = 1;
MessageType type = 2;
ReceiveType receive_type = 3;
int64 org_id = 4;
int64 user_id = 5;
int64 to = 6;
string title = 7;
string content = 8;
string file_urls = 9;
string img_urls = 10;
EntityStatus status = 11;
int64 created_at = 12;
int64 updated_at = 13;
}
message MessageList {
repeated Message data = 1;
Pagination pagination = 2;
}
// ========================================== Relations
enum RelationType {
RELATION_NULL = 0;
RELATION_ORG_USER_PARTNER_SUPPLIER = 1;
RELATION_ORG_USER_PARTNER_LOGISTICS = 2;
}
message Relation {
int64 id = 1;
int64 source_id = 2;
int64 target_id = 3;
RelationType type = 4;
int64 attached_id1 = 5;
int64 attached_id2 = 6;
google.protobuf.StringValue value1 = 7;
google.protobuf.StringValue value2 = 8;
EntityStatus status = 9;
int64 created_at = 10;
int64 updated_at = 11;
}
message RelationsResp {
repeated Relation relations = 1;
Pagination pagination = 2;
}
message PartnersResp {
repeated Relation relations = 1;
Pagination pagination = 2;
map<int64, UserWithOrgInfo> user_map = 3;
}
// =========================================== Dept
message DepartmentEdit {
int64 id = 1;
int64 pid = 2;
int64 org_id = 3;
google.protobuf.StringValue name = 4;
google.protobuf.StringValue description = 5;
google.protobuf.StringValue remark = 6;
EntityStatus status = 7;
}
message Department {
int64 id = 1;
int64 pid = 2;
int64 org_id = 3;
string name = 4;
string description = 5;
string remark = 6;
EntityStatus status = 7;
int64 created_at = 8;
int64 updated_at = 9;
}
message DeptsResp {
repeated Department data = 1;
Pagination pagination = 2;
}
// =========================================== DictItems
message DictItemEdit {
int64 id = 1;
int64 pid = 2;
int64 seq = 3;
google.protobuf.StringValue name = 4;
google.protobuf.StringValue code = 5;
google.protobuf.StringValue description = 6;
google.protobuf.StringValue content = 7;
google.protobuf.StringValue remark = 8;
EntityStatus status = 9;
}
message DictItem {
int64 id = 1;
int64 pid = 2;
int64 seq = 3;
string name = 4;
string code = 5;
string description = 6;
string content = 7;
string remark = 8;
int64 created_at = 9;
int64 updated_at = 10;
EntityStatus status = 11;
}
message DictItemList {
repeated DictItem data = 1;
Pagination pagination = 2;
}
// =========================================== feedback
message Feedback {
int64 id = 1;
int64 type_id = 2;
int64 user_id = 3;
string title = 4;
string content = 5;
string img_urls = 6;
EntityStatus status = 7;
int64 created_at = 8;
int64 updated_at = 9;
string reply = 10;
}
message FeedbackEdit {
int64 id = 1;
int64 type_id = 2;
int64 user_id = 3;
google.protobuf.StringValue title = 4;
google.protobuf.StringValue content = 5;
google.protobuf.StringValue img_urls = 6;
EntityStatus status = 7;
google.protobuf.StringValue reply = 8;
}
message FeedbackList {
repeated Feedback data = 1;
map<int64, DictItem> dict_map = 2;
Pagination pagination = 10;
}