@sakura-skytree/leaf-eats-contracts 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gen/restaurant.ts +37 -1
- package/package.json +1 -1
- package/proto/restaurant.proto +25 -1
package/gen/restaurant.ts
CHANGED
|
@@ -25,6 +25,22 @@ export interface CreateRestaurantResponse {
|
|
|
25
25
|
restaurant: Restaurant | undefined;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export interface CreateCategoryRequest {
|
|
29
|
+
title: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface CreateCategoryResponse {
|
|
33
|
+
category: Category | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface GetRestaurantCategoriesRequest {
|
|
37
|
+
restaurantId: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface GetRestaurantCategoriesResponse {
|
|
41
|
+
categories: Category[];
|
|
42
|
+
}
|
|
43
|
+
|
|
28
44
|
export interface Restaurant {
|
|
29
45
|
id: string;
|
|
30
46
|
name: string;
|
|
@@ -32,12 +48,21 @@ export interface Restaurant {
|
|
|
32
48
|
address: string;
|
|
33
49
|
}
|
|
34
50
|
|
|
51
|
+
export interface Category {
|
|
52
|
+
id: string;
|
|
53
|
+
title: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
35
56
|
export const RESTAURANT_V1_PACKAGE_NAME = "restaurant.v1";
|
|
36
57
|
|
|
37
58
|
export interface RestaurantServiceClient {
|
|
38
59
|
getRestaurants(request: Empty): Observable<GetRestaurantsResponse>;
|
|
39
60
|
|
|
40
61
|
createRestaurant(request: CreateRestaurantRequest): Observable<CreateRestaurantResponse>;
|
|
62
|
+
|
|
63
|
+
createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
|
|
64
|
+
|
|
65
|
+
getRestaurantCategories(request: GetRestaurantCategoriesRequest): Observable<GetRestaurantCategoriesResponse>;
|
|
41
66
|
}
|
|
42
67
|
|
|
43
68
|
export interface RestaurantServiceController {
|
|
@@ -48,11 +73,22 @@ export interface RestaurantServiceController {
|
|
|
48
73
|
createRestaurant(
|
|
49
74
|
request: CreateRestaurantRequest,
|
|
50
75
|
): Promise<CreateRestaurantResponse> | Observable<CreateRestaurantResponse> | CreateRestaurantResponse;
|
|
76
|
+
|
|
77
|
+
createCategory(
|
|
78
|
+
request: CreateCategoryRequest,
|
|
79
|
+
): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
|
|
80
|
+
|
|
81
|
+
getRestaurantCategories(
|
|
82
|
+
request: GetRestaurantCategoriesRequest,
|
|
83
|
+
):
|
|
84
|
+
| Promise<GetRestaurantCategoriesResponse>
|
|
85
|
+
| Observable<GetRestaurantCategoriesResponse>
|
|
86
|
+
| GetRestaurantCategoriesResponse;
|
|
51
87
|
}
|
|
52
88
|
|
|
53
89
|
export function RestaurantServiceControllerMethods() {
|
|
54
90
|
return function (constructor: Function) {
|
|
55
|
-
const grpcMethods: string[] = ["getRestaurants", "createRestaurant"];
|
|
91
|
+
const grpcMethods: string[] = ["getRestaurants", "createRestaurant", "createCategory", "getRestaurantCategories"];
|
|
56
92
|
for (const method of grpcMethods) {
|
|
57
93
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
58
94
|
GrpcMethod("RestaurantService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/restaurant.proto
CHANGED
|
@@ -6,8 +6,10 @@ import "google/protobuf/empty.proto";
|
|
|
6
6
|
|
|
7
7
|
service RestaurantService {
|
|
8
8
|
rpc GetRestaurants(google.protobuf.Empty) returns(GetRestaurantsResponse);
|
|
9
|
-
|
|
10
9
|
rpc CreateRestaurant(CreateRestaurantRequest) returns(CreateRestaurantResponse);
|
|
10
|
+
|
|
11
|
+
rpc CreateCategory(CreateCategoryRequest) returns(CreateCategoryResponse);
|
|
12
|
+
rpc GetRestaurantCategories(GetRestaurantCategoriesRequest) returns(GetRestaurantCategoriesResponse);
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
message GetRestaurantsResponse {
|
|
@@ -24,9 +26,31 @@ message CreateRestaurantResponse {
|
|
|
24
26
|
Restaurant restaurant = 1;
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
message CreateCategoryRequest {
|
|
30
|
+
string restaurant_id = 1;
|
|
31
|
+
string title = 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message CreateCategoryResponse {
|
|
35
|
+
Category category = 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message GetRestaurantCategoriesRequest {
|
|
39
|
+
string restaurant_id = 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message GetRestaurantCategoriesResponse {
|
|
43
|
+
repeated Category categories = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
27
46
|
message Restaurant {
|
|
28
47
|
string id = 1;
|
|
29
48
|
string name = 2;
|
|
30
49
|
string previewUrl = 3;
|
|
31
50
|
string address = 4;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message Category {
|
|
54
|
+
string id = 1;
|
|
55
|
+
string title = 2;
|
|
32
56
|
}
|