MenuService.proto
16.7 KB
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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.infoloop.tianting.menuservice";
option java_outer_classname = "MenuServiceProto";
option objc_class_prefix = "OP";
package com.infoloop.tianting.menuservice;
service MenuServiceRpc {
//餐单
rpc GetMenuById (GetMenuByIdRpcRequest) returns (GetMenuByIdRpcResponse) {}
rpc GetMenusByIds (GetMenusByIdsRpcRequest) returns (GetMenusByIdsRpcResponse) {}
//根据档口Ids获取所有已发布餐单
rpc GetPublishedMenusByStallIds (GetPublishedMenusByStallIdsRpcRequest) returns (GetPublishedMenusByStallIdsRpcResponse) {}
//根据档口Ids获取小程序已发布点餐餐单
rpc GetMicroPublishedMenusByStallIds (GetMicroPublishedMenusByStallIdsRpcRequest) returns (GetMicroPublishedMenusByStallIdsRpcResponse) {}
rpc QueryMenusByCondition (QueryMenusByConditionRpcRequest) returns (QueryMenusByConditionRpcResponse) {}
rpc CreateMenu (CreateMenuRpcRequest) returns (CreateMenuRpcResponse) {}
rpc BatchCreateMenus (BatchCreateMenusRpcRequest) returns (BatchCreateMenusRpcResponse) {}
rpc UpdateMenu (UpdateMenuRpcRequest) returns (UpdateMenuRpcResponse) {}
rpc BatchUpdateMenus (BatchUpdateMenusRpcRequest) returns (BatchUpdateMenusRpcResponse) {}
rpc DeleteMenusByIds (DeleteMenusByIdsRpcRequest) returns (DeleteMenusRpcResponse) {}
//餐单明细
rpc GetMenuDetailById (GetMenuDetailByIdRpcRequest) returns (GetMenuDetailByIdRpcResponse) {}
rpc GetMenuDetailsByIds (GetMenuDetailsByIdsRpcRequest) returns (GetMenuDetailsByIdsRpcResponse) {}
rpc GetMenuDetailsByMenuIds (GetMenuDetailsByMenuIdsRpcRequest) returns (GetMenuDetailsByMenuIdsRpcResponse) {}
rpc QueryMenuDetailsByCondition (QueryMenuDetailsByConditionRpcRequest) returns (QueryMenuDetailsByConditionRpcResponse) {}
rpc CreateMenuDetail (CreateMenuDetailRpcRequest) returns (CreateMenuDetailRpcResponse) {}
rpc BatchCreateMenuDetails (BatchCreateMenuDetailsRpcRequest) returns (BatchCreateMenuDetailsRpcResponse) {}
rpc UpdateMenuDetail (UpdateMenuDetailRpcRequest) returns (UpdateMenuDetailRpcResponse) {}
rpc BatchUpdateMenuDetails (BatchUpdateMenuDetailsRpcRequest) returns (BatchUpdateMenuDetailsRpcResponse) {}
rpc DeleteMenuDetailsByIds (DeleteMenuDetailsByIdsRpcRequest) returns (DeleteMenuDetailsRpcResponse) {}
rpc DeleteMenuDetailsByMenuIds (DeleteMenuDetailsByMenuIdsRpcRequest) returns (DeleteMenuDetailsByMenuIdsRpcResponse) {}
//餐单档口关联
rpc GetMenuStallRefById (GetMenuStallRefByIdRpcRequest) returns (GetMenuStallRefByIdRpcResponse) {}
rpc GetMenuStallRefsByIds (GetMenuStallRefsByIdsRpcRequest) returns (GetMenuStallRefsByIdsRpcResponse) {}
rpc GetMenuStallRefsByStallIds (GetMenuStallRefsByStallIdsRpcRequest) returns (GetMenuStallRefsByStallIdsRpcResponse) {}
rpc GetMenuStallRefsByMenuIds (GetMenuStallRefsByMenuIdsRpcRequest) returns (GetMenuStallRefsByMenuIdsRpcResponse) {}
rpc CreateMenuStallRef (CreateMenuStallRefRpcRequest) returns (CreateMenuStallRefRpcResponse) {}
rpc BatchCreateMenuStallRefs (BatchCreateMenuStallRefsRpcRequest) returns (BatchCreateMenuStallRefsRpcResponse) {}
rpc DeleteMenuStallRefsByStallIds (DeleteMenuStallRefsByStallIdsRpcRequest) returns (DeleteMenuStallRefsByStallIdsRpcResponse) {}
rpc DeleteMenuStallRefsByMenuIds (DeleteMenuStallRefsByMenuIdsRpcRequest) returns (DeleteMenuStallRefsByMenuIdsRpcResponse) {}
//餐单客户关联
rpc GetClientCustomerMenuRefsByCustomerId (GetClientCustomerMenuRefsByCustomerIdRpcRequest) returns (GetClientCustomerMenuRefsByCustomerIdRpcResponse) {}
rpc GetClientCustomerMenuRefsByCustomerIds (GetClientCustomerMenuRefsByCustomerIdsRpcRequest) returns (GetClientCustomerMenuRefsByCustomerIdsRpcResponse) {}
rpc BatchCreateClientCustomerMenuRefs (BatchCreateClientCustomerMenuRefsRpcRequest) returns (BatchCreateClientCustomerMenuRefsRpcResponse) {}
rpc UpdateClientCustomerMenuRefTop (UpdateClientCustomerMenuRefTopRpcRequest) returns (UpdateClientCustomerMenuRefTopRpcResponse) {}
rpc DeleteClientCustomerMenuRefsByIds (DeleteClientCustomerMenuRefsByIdsRpcRequest) returns (DeleteClientCustomerMenuRefsRpcResponse) {}
rpc DeleteClientCustomerMenuRefsByMenuIds (DeleteClientCustomerMenuRefsByMenuIdsRpcRequest) returns (DeleteClientCustomerMenuRefsByMenuIdsRpcResponse) {}
}
enum MenuStatusEnum {
MENU_STATUS_WAITING_MEAL = 0;//待排菜
MENU_STATUS_WAITING_PUBLISH = 1;//待发布
MENU_STATUS_ALREADY_PUBLISHED = 2;//已发布
MENU_STATUS_ALREADY_DISABLED = 3;//已停用
}
message SingleMenuRpcResponse {
int32 id = 1;
int32 enterpriseId = 2;
string code = 3;
string name = 4;
MenuStatusEnum status = 5;
bool customerScope = 6;
string nutritionPromotion = 7;
bool nutritionalStatistics = 8;
OrderRuleJson orderRuleJson = 9;
DishRuleJson dishRuleJson = 10;
int32 createdBy = 11;
int64 createdAt = 12;
int32 creationSource = 13;
int32 updatedBy = 14;
int64 updatedAt = 15;
int32 updateSource = 16;
bool isDeleted = 17;
int64 publishAt = 18;
}
message OrderRuleJson {
CloseTimeTypeEnum closeTimeType = 1;//截单类型
string startTime = 2;//允许下单时间开始
string endTime = 3;//允许下单时间结束
string deadline = 4;//截单时间
int32 earlyDays = 5;//提前天数
DishSelectRuleEnum dishSelectRule = 6;//选菜规则
int32 placeOrderCount = 7;//允许下单次数 0 无限制
bool allowMicroPlaceOrder = 8;//允许小程序下单
ModeOfPaymentEnum modeOfPayment = 9;//支付方式
}
message DishRuleJson {
DishTypeEnum dishType = 1;//排菜类型DishTypeEnum
int32 days = 2; //天数或周几
repeated int32 mealIds = 3;//餐别Ids
}
enum CloseTimeTypeEnum {
IMMEDIATELY = 0;//立即
RESERVATION = 1;//预定
}
enum DishSelectRuleEnum {
CHOOSE_ONE_OF_DISHES = 0;//菜品品类M选1
ADD_OR_REMOVE = 1; //随意增减
FIXED_QUANTITY = 2; //固定数量
DISHES_CATEGORY_CHOOSE_ONE = 3; //菜品品类选1
}
enum ModeOfPaymentEnum {
UNKNOWN = 0;
ONLINE = 1; //在线
OFFLINE = 2; //线下
LEAVE_HOSPITAL = 3;//出院
}
enum DishTypeEnum {
FIXED = 0; //固定
DAY = 1; //按天
WEEK = 2; //按周
}
message GetMenuByIdRpcRequest {
int32 id = 1;
int32 enterpriseId = 2;
bool includeDeleted = 3;
}
message GetMenuByIdRpcResponse {
SingleMenuRpcResponse response = 1;
}
message GetMenusByIdsRpcRequest {
repeated int32 ids = 1;
int32 enterpriseId = 2;
bool includeDeleted = 3;
}
message GetMenusByIdsRpcResponse {
repeated SingleMenuRpcResponse responses = 1;
}
message GetPublishedMenusByStallIdsRpcRequest {
repeated int32 stallIds = 1;
int32 enterpriseId = 2;
}
message GetPublishedMenusByStallIdsRpcResponse {
repeated SingleMenuRpcResponse responses = 1;
}
message GetMicroPublishedMenusByStallIdsRpcRequest {
repeated int32 stallIds = 1;
int32 enterpriseId = 2;
bool includeDeleted = 3;
}
message GetMicroPublishedMenusByStallIdsRpcResponse {
repeated SingleMenuRpcResponse responses = 1;
}
message GetPublishedMenusByStallIdsAndCustomerScopeRpcRequest {
repeated int32 stallIds = 1;
int32 enterpriseId = 2;
bool customerScope = 3;
}
message QueryMenusByConditionRpcRequest {
int32 enterpriseId = 1;
bool shouldFilterCode = 2;
string code = 3;
bool shouldFilterName = 4;
string name = 5;
bool shouldFilterStatuses = 6;
repeated MenuStatusEnum statuses = 7;
bool includeDeleted = 8;
bool shouldFilterCreatedAt = 9;
int64 createdAtStart = 10;
int64 createdAtEnd = 11;
}
message QueryMenusByConditionRpcResponse {
repeated SingleMenuRpcResponse responses = 1;
}
message MenuCreation{
string code = 1;
string name = 2;
MenuStatusEnum status = 3;
bool customerScope = 4;
bool shouldCreateNutritionPromotion = 5;
string nutritionPromotion = 6;
bool nutritionalStatistics = 7;
bool shouldCreateOrderRuleJson = 8;
OrderRuleJson orderRuleJson = 9;
bool shouldCreateDishRuleJson = 10;
DishRuleJson dishRuleJson = 11;
bool shouldCreatePublishAt = 12;
int64 publishAt = 13;
}
message CreateMenuRpcRequest {
MenuCreation creation = 1;
int32 enterpriseId = 2;
int32 createdBy = 3;
int32 creationSource = 4;
}
message CreateMenuRpcResponse {
int32 id = 1;
bool isCreated = 2;
}
message BatchCreateMenusRpcRequest {
repeated MenuCreation creations = 1;
int32 enterpriseId = 2;
int32 createdBy = 3;
int32 creationSource = 4;
}
message BatchCreateMenusRpcResponse {
repeated int32 ids = 1;
bool isCreated = 2;
}
message MenuModification {
int32 id = 1;
bool shouldUpdateCode = 2;
string code = 3;
bool shouldUpdateName = 4;
string name = 5;
bool shouldUpdateStatus = 6;
MenuStatusEnum status = 7;
bool shouldUpdateCustomerScope = 8;
bool customerScope = 9;
bool shouldUpdateNutritionPromotion = 10;
string nutritionPromotion = 11;
bool shouldUpdateNutritionalStatistics = 12;
bool nutritionalStatistics = 13;
bool shouldUpdateOrderRuleJson = 14;
OrderRuleJson orderRuleJson = 15;
bool shouldUpdateDishRuleJson = 16;
DishRuleJson dishRuleJson = 17;
bool shouldUpdatePublishAt = 18;
int64 publishAt = 19;
}
message UpdateMenuRpcRequest {
MenuModification modification = 1;
int32 enterpriseId = 2;
int32 updatedBy = 3;
int32 updateSource = 4;
}
message UpdateMenuRpcResponse {
bool isUpdated = 1;
}
message BatchUpdateMenusRpcRequest {
repeated MenuModification modifications = 1;
int32 enterpriseId = 2;
int32 updatedBy = 3;
int32 updateSource = 4;
}
message BatchUpdateMenusRpcResponse {
bool isUpdated = 1;
}
message DeleteMenusByIdsRpcRequest {
repeated int32 ids = 1;
int32 enterpriseId = 2;
int32 updatedBy = 3;
int32 updateSource = 4;
}
message DeleteMenusRpcResponse {
bool isDeleted = 1;
}
message SingleMenuDetailRpcResponse {
int32 id = 1;
int32 enterpriseId = 2;
int32 menuId = 3;
int32 days = 4;
int32 mealId = 5;
int32 categoryId = 6;
int32 skuId = 7;
string showName = 8;
int32 price = 9;
int32 createdBy = 10;
int64 createdAt = 11;
int32 creationSource = 12;
int32 updatedBy = 13;
int64 updatedAt = 14;
int32 updateSource = 15;
bool isDeleted = 16;
repeated string categoryNames = 17;
int32 sort = 18;
}
message GetMenuDetailByIdRpcRequest {
int32 id = 1;
int32 enterpriseId = 2;
bool includeDeleted = 3;
}
message GetMenuDetailByIdRpcResponse {
SingleMenuDetailRpcResponse response = 1;
}
message GetMenuDetailsByIdsRpcRequest {
repeated int32 ids = 1;
int32 enterpriseId = 2;
bool includeDeleted = 3;
}
message GetMenuDetailsByIdsRpcResponse {
repeated SingleMenuDetailRpcResponse responses = 1;
}
message GetMenuDetailsByMenuIdsRpcRequest {
repeated int32 menuIds = 1;
int32 enterpriseId = 2;
bool includeDeleted = 3;
}
message GetMenuDetailsByMenuIdsRpcResponse {
repeated SingleMenuDetailRpcResponse responses = 1;
}
message QueryMenuDetailsByConditionRpcRequest {
int32 enterpriseId = 1;
bool shouldFilterMenuIds = 2;
repeated int32 menuIds = 3;
bool shouldFilterDays = 4;
repeated int32 days = 5;
bool includeDeleted = 6;
}
message QueryMenuDetailsByConditionRpcResponse {
repeated SingleMenuDetailRpcResponse responses = 1;
}
message MenuDetailCreation{
int32 menuId = 1;
int32 days = 2;
int32 mealId = 3;
int32 categoryId = 4;
int32 skuId = 5;
bool shouldCreateShowName = 6;
string showName = 7;
int32 price = 8;
repeated string categoryNames = 9;
int32 sort = 10;
}
message CreateMenuDetailRpcRequest {
MenuDetailCreation creation = 1;
int32 enterpriseId = 2;
int32 createdBy = 3;
int32 creationSource = 4;
}
message CreateMenuDetailRpcResponse {
int32 id = 1;
bool isCreated = 2;
}
message BatchCreateMenuDetailsRpcRequest {
repeated MenuDetailCreation creations = 1;
int32 enterpriseId = 2;
int32 createdBy = 3;
int32 creationSource = 4;
}
message BatchCreateMenuDetailsRpcResponse {
repeated int32 ids = 1;
bool isCreated = 2;
}
message MenuDetailModification {
int32 id = 1;
bool shouldUpdateMenuId = 2;
int32 menuId = 3;
bool shouldUpdateDays = 4;
int32 days = 5;
bool shouldUpdateMealId = 6;
int32 mealId = 7;
bool shouldUpdateCategoryId = 8;
int32 categoryId = 9;
bool shouldUpdateSkuId = 10;
int32 skuId = 11;
bool shouldUpdateShowName = 12;
string showName = 13;
bool shouldUpdatePrice = 14;
int32 price = 15;
bool shouldUpdateCategoryNames = 16;
repeated string categoryNames = 17;
bool shouldUpdateSort = 18;
int32 sort = 19;
}
message UpdateMenuDetailRpcRequest {
MenuDetailModification modification = 1;
int32 enterpriseId = 2;
int32 updatedBy = 3;
int32 updateSource = 4;
}
message UpdateMenuDetailRpcResponse {
bool isUpdated = 1;
}
message BatchUpdateMenuDetailsRpcRequest {
repeated MenuDetailModification modifications = 1;
int32 enterpriseId = 2;
int32 updatedBy = 3;
int32 updateSource = 4;
}
message BatchUpdateMenuDetailsRpcResponse {
bool isUpdated = 1;
}
message DeleteMenuDetailsByIdsRpcRequest {
repeated int32 ids = 1;
int32 enterpriseId = 2;
int32 updatedBy = 3;
int32 updateSource = 4;
}
message DeleteMenuDetailsRpcResponse {
bool isDeleted = 1;
}
message DeleteMenuDetailsByMenuIdsRpcRequest {
repeated int32 menuIds = 1;
int32 enterpriseId = 2;
int32 updatedBy = 3;
int32 updateSource = 4;
}
message DeleteMenuDetailsByMenuIdsRpcResponse {
bool isDeleted = 1;
}
message SingleMenuStallRefRpcResponse {
int32 id = 1;
int32 enterpriseId = 2;
int32 menuId = 3;
int32 stallId = 4;
int32 createdBy = 5;
int64 createdAt = 6;
int32 creationSource = 7;
}
message GetMenuStallRefByIdRpcRequest {
int32 id = 1;
int32 enterpriseId = 2;
}
message GetMenuStallRefByIdRpcResponse {
SingleMenuStallRefRpcResponse response = 1;
}
message GetMenuStallRefsByIdsRpcRequest {
repeated int32 ids = 1;
int32 enterpriseId = 2;
}
message GetMenuStallRefsByIdsRpcResponse {
repeated SingleMenuStallRefRpcResponse responses = 1;
}
message GetMenuStallRefsByStallIdsRpcRequest {
int32 enterpriseId = 1;
repeated int32 stallIds = 2;
}
message GetMenuStallRefsByStallIdsRpcResponse {
repeated SingleMenuStallRefRpcResponse responses = 1;
}
message GetMenuStallRefsByMenuIdsRpcRequest {
int32 enterpriseId = 1;
repeated int32 menuIds = 2;
}
message GetMenuStallRefsByMenuIdsRpcResponse {
repeated SingleMenuStallRefRpcResponse responses = 1;
}
message MenuStallRefCreation{
int32 menuId = 1;
int32 stallId = 2;
}
message CreateMenuStallRefRpcRequest {
MenuStallRefCreation creation = 1;
int32 enterpriseId = 2;
int32 createdBy = 3;
int32 creationSource = 4;
}
message CreateMenuStallRefRpcResponse {
int32 id = 1;
bool isCreated = 2;
}
message BatchCreateMenuStallRefsRpcRequest {
repeated MenuStallRefCreation creations = 1;
int32 enterpriseId = 2;
int32 createdBy = 3;
int32 creationSource = 4;
}
message BatchCreateMenuStallRefsRpcResponse {
repeated int32 ids = 1;
bool isCreated = 2;
}
message DeleteMenuStallRefsByStallIdsRpcRequest {
int32 enterpriseId = 1;
int32 menuId = 2;
repeated int32 stallIds = 3;
}
message DeleteMenuStallRefsByStallIdsRpcResponse {
bool isDeleted = 1;
}
message DeleteMenuStallRefsByMenuIdsRpcRequest {
int32 enterpriseId = 1;
repeated int32 menuIds = 2;
}
message DeleteMenuStallRefsByMenuIdsRpcResponse {
bool isDeleted = 1;
}
message SingleClientCustomerMenuRefRpcResponse {
int32 id = 1;
int32 enterpriseId = 2;
int32 menuId = 3;
int32 customerId = 4;
int64 bindAt = 5;
bool isTop = 6;
int32 createdBy = 7;
int64 createdAt = 8;
int32 creationSource = 9;
}
message GetClientCustomerMenuRefsByCustomerIdRpcRequest {
int32 customerId = 1;
int32 enterpriseId = 2;
}
message GetClientCustomerMenuRefsByCustomerIdRpcResponse {
repeated SingleClientCustomerMenuRefRpcResponse responses = 1;
}
message GetClientCustomerMenuRefsByCustomerIdsRpcRequest {
repeated int32 customerIds = 1;
int32 enterpriseId = 2;
}
message GetClientCustomerMenuRefsByCustomerIdsRpcResponse {
repeated SingleClientCustomerMenuRefRpcResponse responses = 1;
}
message ClientCustomerMenuRefCreation{
int32 menuId = 1;
int32 customerId = 2;
int64 bindAt = 3;
bool isTop = 4;
}
message BatchCreateClientCustomerMenuRefsRpcRequest {
repeated ClientCustomerMenuRefCreation creations = 1;
int32 enterpriseId = 2;
int32 createdBy = 3;
int32 creationSource = 4;
}
message BatchCreateClientCustomerMenuRefsRpcResponse {
repeated int32 ids = 1;
bool isCreated = 2;
}
message UpdateClientCustomerMenuRefTopRpcRequest {
int32 menuId = 1;
int32 customerId = 2;
int32 enterpriseId = 3;
}
message UpdateClientCustomerMenuRefTopRpcResponse {
bool isUpdated = 1;
}
message DeleteClientCustomerMenuRefsByIdsRpcRequest {
repeated int32 ids = 1;
int32 enterpriseId = 2;
}
message DeleteClientCustomerMenuRefsRpcResponse {
bool isDeleted = 1;
}
message DeleteClientCustomerMenuRefsByMenuIdsRpcRequest {
repeated int32 menuIds = 1;
int32 customerId = 2;
int32 enterpriseId = 3;
}
message DeleteClientCustomerMenuRefsByMenuIdsRpcResponse {
bool isDeleted = 1;
}