-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdal_user.proto
264 lines (262 loc) · 7.32 KB
/
dal_user.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
syntax = "proto3";
option java_package = "com.bootapp.grpc.core";
import "core_common.proto";
package proto;
// add credential to prevent evil usage
service DalUserService {
//--------------------------------------------------- user
//--- Create a User
rpc CreateUser(CreateUserReq) returns (UserWithOrgAuth);
//--- Create users
rpc CreateUsers(CreateUsersReq) returns (UsersResp);
//--- Update a User
rpc UpdateUser(UpdateUserReq) returns (Empty);
//--- Read a single user with auth
rpc ReadUserAuth(ReadUserReq) returns (UserWithOrgAuth);
//--- Read a user list
rpc ReadUsers(ReadUsersReq) returns (UsersResp);
//-------- others
rpc VerifyUniqueUser(User) returns (Empty);
rpc ReadUserIds(AuthorizedPaginationReq) returns (IdsResp);
//--------------------------------------------------- dictionary
rpc UpdateDictItems(DictItemsReq) returns (Empty);
rpc ReadDictItems(ReadDictItemsReq) returns (DictItemList);
rpc DeleteDictItems(AuthorizedIdsReq) returns (Empty);
//--------------------------------------------------- org
rpc UpdateOrgs(OrgsReq) returns (Empty);
rpc ReadOrgs(ReadOrgsReq) returns (OrgsResp);
//--------------------------------------------------- user-org
rpc UpdateUserOrgs(CreateUserOrgsReq) returns (Empty);
rpc ReadUserOrgs(AuthorizedReq) returns (UserOrgsResp);
rpc DeleteUserOrgs(AuthorizedIdsReq) returns (Empty);
rpc CreateOrgAndUserOrg(CreateOrgUserOrgReq) returns (Empty) {}
// ========================================= dept
rpc UpdateDepts(DeptsReq) returns (Empty);
rpc ReadDepts(ReadDeptsReq) returns (DeptsResp);
// --------------------------------------------------- relation
rpc UpdateRelations(UpdateRelationsReq) returns (Empty);
rpc ReadRelations(ReadRelationsReq) returns (RelationsResp);
rpc DeleteRelations(AuthorizedIdsReq) returns (Empty);
// ---- extra
rpc ReadPartners(ReadPartnersReq) returns (PartnersResp);
rpc ReadPartnersIn(ReadPartnersInReq) returns (PartnersResp);
// --------------------------------------------------- message
rpc UpdateMessage(MessageReq) returns (Empty);
rpc ReadMessages(ReadMessagesReq) returns(MessageList);
// ---- inbox
rpc CreateInbox(CreateInboxReq) returns (Empty);
rpc UpdateInbox(UpdateInboxReq) returns (Empty);
rpc DeleteInbox(UpdateInboxReq) returns (Empty);
rpc ReadInbox(ReadInboxReq) returns (MessageList);
// --------------------------------------------------- feedback
rpc UpdateFeedback(FeedbackReq) returns (Empty);
rpc ReadFeedback(ReadFeedbackReq) returns (FeedbackList);
}
message IdsResp {
repeated int64 ids = 1;
Pagination pagination = 10;
}
message CreateInboxReq {
int64 user_id = 1;
int64 org_id = 2;
int64 msg_id = 3;
repeated int64 to_user_ids = 4;
}
// =========================================== Feedback
message FeedbackReq {
int64 user_id = 1;
int64 org_id = 2;
FeedbackEdit item = 3;
}
message ReadFeedbackReq {
int64 user_id = 1;
int64 org_id = 2;
EntityStatus status = 3;
int64 id = 4;
Pagination pagination = 10;
}
// =========================================== DictItems
message DictItemsReq {
int64 user_id = 1;
int64 org_id = 2;
repeated DictItemEdit data = 3;
}
message ReadDictItemsReq {
int64 user_id = 1;
int64 org_id = 2;
repeated int64 ids = 3;
int64 pid = 4;
EntityStatus status = 5;
Pagination pagination = 10;
}
message CreateOrgUserOrgReq {
int64 user_id = 1;
int64 org_id = 2;
int64 user_role_id = 3;
OrganizationEdit org = 4;
}
message UserOrg {
int64 id = 1;
int64 user_id = 2;
int64 org_id = 3;
int64 user_role_id = 4;
int64 created_at = 5;
int64 updated_at = 6;
}
message CreateUserOrgsReq {
int64 user_id = 1;
int64 org_id = 2;
repeated UserOrg data = 3;
}
enum UpdateUserType {
UPDATE_USER_TYPE_NULL = 0;
UPDATE_USER_TYPE_ID = 1;
UPDATE_USER_TYPE_USERNAME = 2;
UPDATE_USER_TYPE_PHONE = 3;
UPDATE_USER_TYPE_EMAIL = 4;
}
message UserOrgsResp {
repeated UserOrg data = 1;
}
// =========================================== Dept
message DeptsReq {
int64 org_id = 1;
int64 user_id = 2;
repeated DepartmentEdit data = 3;
}
message ReadDeptsReq {
int64 org_id = 1;
int64 user_id = 2;
DepartmentEdit dept = 3;
Pagination pagination = 4;
}
// =========================================== User
message CreateUserReq {
int64 org_id = 1;
int64 user_id = 2;
UserEdit user = 3;
int64 user_org_id = 4;
int64 user_role_id = 5;
}
message CreateUsersReq {
int64 org_id = 1;
int64 user_id = 2;
int64 role_id = 3;
repeated UserEdit data = 4;
}
message UserWithOrgEdit {
UserEdit user = 1;
OrganizationEdit org = 2;
}
message CreateUsersWithOrgReq {
int64 org_id = 1;
int64 user_id = 2;
int64 role_id = 3;
repeated UserWithOrgEdit data = 4;
}
message ReadUserReq {
int64 id = 1;
int64 org_id = 2;
int64 user_id = 3;
repeated int64 ids = 4;
string phone = 5;
string email = 6;
string username = 7;
string password = 8;
}
message UpdateUserReq {
int64 org_id = 1;
int64 user_id = 2;
UpdateUserType type = 3;
UserEdit user = 4;
}
message ReadUsersReq {
int64 org_id = 1;
int64 user_id = 2;
repeated int64 ids = 3;
string phone = 4;
string email = 5;
string username = 6;
EntityStatus status = 7;
Pagination pagination = 10;
}
message ReadUsersInReq {
int64 org_id = 1;
int64 user_id = 2;
repeated int64 user_ids = 3;
repeated string phones = 5;
repeated string emails = 6;
repeated string usernames = 7;
}
// =========================================== Org
message OrgsReq {
int64 org_id = 1;
int64 user_id = 2;
repeated OrganizationEdit data = 3;
}
message ReadOrgsReq {
int64 org_id = 1;
int64 user_id = 2;
OrganizationEdit org = 3;
Pagination pagination = 4;
}
// =========================================== Relation
message UpdateRelationsReq {
int64 org_id = 1;
int64 user_id = 2;
repeated Relation relation = 3;
}
message ReadRelationsReq {
int64 org_id = 1;
int64 user_id = 2;
Relation relation = 3;
Pagination pagination = 100;
}
message ReadPartnersReq {
int64 org_id = 1;
int64 user_id = 2;
RelationType type = 3;
string org_serial_number = 4;
string org_name = 5;
string contact_name = 6;
string contact_phone = 7;
string contact_email = 8;
Pagination pagination = 100;
}
message ReadPartnersInReq {
int64 org_id = 1;
int64 user_id = 2;
repeated int64 partner_ids = 3;
}
// =========================================== Message
message MessageReq {
int64 org_id = 1;
int64 user_id = 2;
MessageEdit msg = 3;
}
message ReadMessagesReq {
int64 org_id = 1;
int64 user_id = 2;
int64 from_user_id = 3;
int64 to_user_id = 4;
string title = 5;
string content = 6;
MessageType type = 7;
ReceiveType receive_type = 8;
EntityStatus status = 9;
Pagination pagination = 100;
}
message UpdateInboxReq {
int64 org_id = 1;
int64 user_id = 2;
repeated int64 ids = 3;
EntityStatus status = 4;
}
message ReadInboxReq {
int64 org_id = 1;
int64 user_id = 2;
EntityStatus status = 3;
int64 update_at = 4;
Pagination pagination = 5;
int64 query_user_id = 6;
}