-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.proto
262 lines (207 loc) · 4.92 KB
/
server.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
syntax = "proto3";
option go_package = "../pb";
//protoc --go_out=./pb --go-grpc_out=./pb server.proto
package notification;
// 定义订阅请求消息
// 定义通知服务
service NotificationService {
// 订阅更新,服务器端流式 RPC
rpc Subscribe (SubscriptionRequest) returns (stream Notification);
}
message SubscriptionRequest {
string client_id = 1; // 客户端标识符,用于区分不同客户端
}
// 定义通知消息
message Notification {
string message = 1; // 通知内容
}
message PublishRequest {
string client_id = 1;
string message = 2;
}
message PublishResponse {
bool success = 1;
}
// 定义服务
service Service {
rpc SayHello (testRequest) returns (testReply);
rpc Login (LoginRequest) returns (LoginReply);
rpc Register (RegisterRequest) returns (RegisterReply);
rpc GetUserInfo (GetUserInfoRequest) returns (GetUserInfoReply);
rpc ModUserInfo (ModUserInfoRequest) returns (ModUserInfoReply);
rpc GetAllUserName (GetAllUserNameRequest) returns (GetAllUserNameReply);
//修改单/任务
rpc GetTaskListAll (GetTaskListAllRequest) returns (GetTaskListAllReply);
rpc GetTaskListByName (GetTaskListOneRequest) returns (GetTaskListOneReply);
rpc GetTaskById (GetTaskByIdRequest) returns (GetTaskByIdReply);
rpc ImportXLSToTaskTable (ImportToTaskListRequest) returns (ImportToTaskListReply);
//CURD
rpc DelTask (DelTaskRequest) returns (DelTaskReply);
rpc ModTask (ModTaskRequest) returns (ModTaskReply);
rpc AddTask (AddTaskRequest) returns (AddTaskReply);
rpc QueryTaskBySQL (QueryTaskWithSQLRequest) returns (QueryTaskWithSQLReply);
rpc QueryTaskByField (QueryTaskWithFieldRequest) returns (QueryTaskWithFieldReply);
//补丁
rpc GetPatchsAll (GetPatchsAllRequest) returns (GetPatchsAllReply);
rpc GetOnePatchs (GetOnePatchsRequest) returns (GetOnePatchsReply);
rpc QueryPatchsWithField (QueryPatchsWithFieldRequest) returns (QueryPatchsWithFieldReply);
rpc DelPatch (DelPatchRequest) returns (DelPatchReply);
rpc ImportXLSToPatchTable (ImportXLSToPatchRequest) returns (ImportXLSToPatchReply);
rpc ModPatch (ModPatchRequest) returns (ModPatchReply);
}
message LoginRequest {
string name = 1;
string password = 2;
}
message LoginReply {
}
message task {
string comment = 1;
string taskId = 2;
int32 emergencyLevel = 3;
string deadline = 4;
string principal = 5;
string reqNo = 6;
int32 estimatedWorkHours = 7;
string state = 8;
int32 typeId = 9;
}
message GetTaskListAllRequest {}
message GetTaskListAllReply {
repeated task tasks = 1;
}
message GetTaskListOneRequest {
string name = 1;
}
message GetTaskListOneReply {
repeated task tasks = 1;
}
message GetTaskByIdRequest {
string taskId = 1;
}
message GetTaskByIdReply {
task t = 1;
}
message ImportToTaskListRequest {
repeated task tasks = 1;
string user = 2;
}
message ImportToTaskListReply {
int32 insertCnt = 1;
}
message patch {
string patchNo = 1;
string reqNo = 2;
string describe = 3;
string clientName = 4;
string deadline = 5;
string reason = 6;
string sponsor = 7;
string state = 8;
}
message ImportXLSToPatchRequest {
repeated patch patchs = 1;
string user = 2;
}
message ImportXLSToPatchReply {
}
message GetPatchsAllRequest {}
message GetPatchsAllReply {
repeated patch patchs = 1;
}
message DelPatchRequest {
string patchNo = 1;
string user = 2;
}
message DelPatchReply {}
message DelTaskRequest {
string taskNo = 1;
string user = 2;
string principal = 3;
}
message DelTaskReply {}
message ModTaskRequest {
task t = 1;
string user = 2;
}
message ModTaskReply {
}
message AddTaskRequest {
task t = 1;
string user = 2;
}
message AddTaskReply {
}
message QueryTaskWithSQLRequest {
string sql = 1;
}
message QueryTaskWithSQLReply {
repeated task tasks = 1;
}
message QueryTaskWithFieldRequest {
string field = 1;
string fieldValue = 2;
}
message QueryTaskWithFieldReply {
repeated task tasks = 1;
}
message GetOnePatchsRequest {
string patchNo = 1;
}
message GetOnePatchsReply {
patch p = 1;
}
message QueryPatchsWithFieldRequest {
string fieldName = 1;
string fieldValue = 2;
}
message QueryPatchsWithFieldReply {
repeated patch ps = 1;
}
message ModPatchRequest {
patch p = 1;
string user = 2;
}
message ModPatchReply {
}
message User {
string name = 1;
int64 JobNum = 2;
string password = 3;
string email = 4;
}
message RegisterRequest {
User user = 1;
}
message RegisterReply {
}
message GetUserInfoRequest {
string userName = 1;
}
message GetUserInfoReply {
int32 jobNO = 1;
string email = 2;
int32 group = 3;
int32 roleNo = 4;
}
message ModUserInfoRequest {
bool modPass = 1;
string pass = 2;
string email = 3;
int32 group = 4;
int32 roleNo = 5;
string name = 6;
}
message ModUserInfoReply{
}
message GetAllUserNameRequest {
}
message GetAllUserNameReply {
repeated string names = 1;
}
message testRequest {
string name = 1;
}
message testReply {
string answer = 1;
}