@barumetric/contracts 1.2.16 → 1.3.1
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/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/ts/ad.ts +234 -0
- package/gen/ts/categories.ts +71 -1
- package/package.json +1 -1
- package/proto/ad.proto +162 -0
- package/proto/categories.proto +49 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -10,4 +10,5 @@ exports.PROTO_PATHS = {
|
|
|
10
10
|
CATEGORIES: (0, path_1.join)(__dirname, "../../proto/categories.proto"),
|
|
11
11
|
SESSION: (0, path_1.join)(__dirname, "../../proto/session.proto"),
|
|
12
12
|
PRESENCE: (0, path_1.join)(__dirname, "../../proto/presence.proto"),
|
|
13
|
+
AD: (0, path_1.join)(__dirname, "../../proto/ad.proto"),
|
|
13
14
|
};
|
package/gen/ts/ad.ts
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: ad.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "ad.v1";
|
|
12
|
+
|
|
13
|
+
export enum AdStatus {
|
|
14
|
+
AD_STATUS_UNSPECIFIED = 0,
|
|
15
|
+
AD_STATUS_DRAFT = 1,
|
|
16
|
+
AD_STATUS_MODERATION = 2,
|
|
17
|
+
AD_STATUS_ACTIVE = 3,
|
|
18
|
+
AD_STATUS_SOLD = 4,
|
|
19
|
+
AD_STATUS_ARCHIVED = 5,
|
|
20
|
+
AD_STATUS_REJECTED = 6,
|
|
21
|
+
UNRECOGNIZED = -1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CreateAdRequest {
|
|
25
|
+
userId: string;
|
|
26
|
+
categoryId: string;
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
price: number;
|
|
30
|
+
currency?: string | undefined;
|
|
31
|
+
location?: Location | undefined;
|
|
32
|
+
attributes?: Attributes | undefined;
|
|
33
|
+
imageUrls: string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface UpdateAdRequest {
|
|
37
|
+
id: string;
|
|
38
|
+
userId: string;
|
|
39
|
+
categoryId?: string | undefined;
|
|
40
|
+
title?: string | undefined;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
price?: number | undefined;
|
|
43
|
+
currency?: string | undefined;
|
|
44
|
+
location?: Location | undefined;
|
|
45
|
+
attributes?: Attributes | undefined;
|
|
46
|
+
imageUrls: string[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GetAdRequest {
|
|
50
|
+
id: string;
|
|
51
|
+
/** для проверки прав доступа */
|
|
52
|
+
userId?: string | undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface DeleteAdRequest {
|
|
56
|
+
id: string;
|
|
57
|
+
userId: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ListAdsRequest {
|
|
61
|
+
categoryId?: string | undefined;
|
|
62
|
+
userId?: string | undefined;
|
|
63
|
+
status?: AdStatus | undefined;
|
|
64
|
+
page: number;
|
|
65
|
+
pageSize: number;
|
|
66
|
+
minPrice?: number | undefined;
|
|
67
|
+
maxPrice?:
|
|
68
|
+
| number
|
|
69
|
+
| undefined;
|
|
70
|
+
/** "created_at", "price", "views" */
|
|
71
|
+
sortBy?:
|
|
72
|
+
| string
|
|
73
|
+
| undefined;
|
|
74
|
+
/** "asc", "desc" */
|
|
75
|
+
sortOrder?: string | undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface GetMyAdsRequest {
|
|
79
|
+
userId: string;
|
|
80
|
+
status?: AdStatus | undefined;
|
|
81
|
+
page: number;
|
|
82
|
+
pageSize: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface PublishAdRequest {
|
|
86
|
+
id: string;
|
|
87
|
+
userId: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface ArchiveAdRequest {
|
|
91
|
+
id: string;
|
|
92
|
+
userId: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface CreateAdResponse {
|
|
96
|
+
ad: Ad | undefined;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface GetAdResponse {
|
|
100
|
+
ad: Ad | undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface UpdateAdResponse {
|
|
104
|
+
ad: Ad | undefined;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface DeleteAdResponse {
|
|
108
|
+
ok: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ListAdsResponse {
|
|
112
|
+
ads: Ad[];
|
|
113
|
+
total: number;
|
|
114
|
+
page: number;
|
|
115
|
+
pageSize: number;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface PublishAdResponse {
|
|
119
|
+
ad: Ad | undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface ArchiveAdResponse {
|
|
123
|
+
ad: Ad | undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface Ad {
|
|
127
|
+
id: string;
|
|
128
|
+
userId: string;
|
|
129
|
+
categoryId: string;
|
|
130
|
+
title: string;
|
|
131
|
+
description?: string | undefined;
|
|
132
|
+
price: number;
|
|
133
|
+
currency: string;
|
|
134
|
+
status: AdStatus;
|
|
135
|
+
location?: Location | undefined;
|
|
136
|
+
attributes?: Attributes | undefined;
|
|
137
|
+
images: AdImage[];
|
|
138
|
+
views: number;
|
|
139
|
+
favorites: number;
|
|
140
|
+
promoted: boolean;
|
|
141
|
+
promotedUntil?: number | undefined;
|
|
142
|
+
createdAt: number;
|
|
143
|
+
updatedAt: number;
|
|
144
|
+
publishedAt?: number | undefined;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface AdImage {
|
|
148
|
+
id: string;
|
|
149
|
+
url: string;
|
|
150
|
+
order: number;
|
|
151
|
+
isPrimary: boolean;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface Location {
|
|
155
|
+
lat: number;
|
|
156
|
+
lng: number;
|
|
157
|
+
address?: string | undefined;
|
|
158
|
+
city?: string | undefined;
|
|
159
|
+
region?: string | undefined;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface Attributes {
|
|
163
|
+
/** key-value пары атрибутов */
|
|
164
|
+
values: { [key: string]: string };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface Attributes_ValuesEntry {
|
|
168
|
+
key: string;
|
|
169
|
+
value: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export const AD_V1_PACKAGE_NAME = "ad.v1";
|
|
173
|
+
|
|
174
|
+
export interface AdServiceClient {
|
|
175
|
+
createAd(request: CreateAdRequest): Observable<CreateAdResponse>;
|
|
176
|
+
|
|
177
|
+
getAd(request: GetAdRequest): Observable<GetAdResponse>;
|
|
178
|
+
|
|
179
|
+
updateAd(request: UpdateAdRequest): Observable<UpdateAdResponse>;
|
|
180
|
+
|
|
181
|
+
deleteAd(request: DeleteAdRequest): Observable<DeleteAdResponse>;
|
|
182
|
+
|
|
183
|
+
listAds(request: ListAdsRequest): Observable<ListAdsResponse>;
|
|
184
|
+
|
|
185
|
+
getMyAds(request: GetMyAdsRequest): Observable<ListAdsResponse>;
|
|
186
|
+
|
|
187
|
+
publishAd(request: PublishAdRequest): Observable<PublishAdResponse>;
|
|
188
|
+
|
|
189
|
+
archiveAd(request: ArchiveAdRequest): Observable<ArchiveAdResponse>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface AdServiceController {
|
|
193
|
+
createAd(request: CreateAdRequest): Promise<CreateAdResponse> | Observable<CreateAdResponse> | CreateAdResponse;
|
|
194
|
+
|
|
195
|
+
getAd(request: GetAdRequest): Promise<GetAdResponse> | Observable<GetAdResponse> | GetAdResponse;
|
|
196
|
+
|
|
197
|
+
updateAd(request: UpdateAdRequest): Promise<UpdateAdResponse> | Observable<UpdateAdResponse> | UpdateAdResponse;
|
|
198
|
+
|
|
199
|
+
deleteAd(request: DeleteAdRequest): Promise<DeleteAdResponse> | Observable<DeleteAdResponse> | DeleteAdResponse;
|
|
200
|
+
|
|
201
|
+
listAds(request: ListAdsRequest): Promise<ListAdsResponse> | Observable<ListAdsResponse> | ListAdsResponse;
|
|
202
|
+
|
|
203
|
+
getMyAds(request: GetMyAdsRequest): Promise<ListAdsResponse> | Observable<ListAdsResponse> | ListAdsResponse;
|
|
204
|
+
|
|
205
|
+
publishAd(request: PublishAdRequest): Promise<PublishAdResponse> | Observable<PublishAdResponse> | PublishAdResponse;
|
|
206
|
+
|
|
207
|
+
archiveAd(request: ArchiveAdRequest): Promise<ArchiveAdResponse> | Observable<ArchiveAdResponse> | ArchiveAdResponse;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function AdServiceControllerMethods() {
|
|
211
|
+
return function (constructor: Function) {
|
|
212
|
+
const grpcMethods: string[] = [
|
|
213
|
+
"createAd",
|
|
214
|
+
"getAd",
|
|
215
|
+
"updateAd",
|
|
216
|
+
"deleteAd",
|
|
217
|
+
"listAds",
|
|
218
|
+
"getMyAds",
|
|
219
|
+
"publishAd",
|
|
220
|
+
"archiveAd",
|
|
221
|
+
];
|
|
222
|
+
for (const method of grpcMethods) {
|
|
223
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
224
|
+
GrpcMethod("AdService", method)(constructor.prototype[method], method, descriptor);
|
|
225
|
+
}
|
|
226
|
+
const grpcStreamMethods: string[] = [];
|
|
227
|
+
for (const method of grpcStreamMethods) {
|
|
228
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
229
|
+
GrpcStreamMethod("AdService", method)(constructor.prototype[method], method, descriptor);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export const AD_SERVICE_NAME = "AdService";
|
package/gen/ts/categories.ts
CHANGED
|
@@ -80,6 +80,51 @@ export interface CategoryAttribute {
|
|
|
80
80
|
enumValues: EnumValue[];
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
export interface CreateCategoryRequest {
|
|
84
|
+
name: string;
|
|
85
|
+
slug: string;
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
parentId?: string | undefined;
|
|
88
|
+
sortOrder: number;
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
iconUrl?: string | undefined;
|
|
91
|
+
bannerUrl?: string | undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface CreateCategoryResponse {
|
|
95
|
+
ok: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface UpdateCategoryRequest {
|
|
99
|
+
name: string;
|
|
100
|
+
slug: string;
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
parentId?: string | undefined;
|
|
103
|
+
sortOrder: number;
|
|
104
|
+
isActive: boolean;
|
|
105
|
+
iconUrl?: string | undefined;
|
|
106
|
+
bannerUrl?: string | undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface UpdateCategoryResponse {
|
|
110
|
+
ok: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface DeleteCategoryRequest {
|
|
114
|
+
name: string;
|
|
115
|
+
slug: string;
|
|
116
|
+
description?: string | undefined;
|
|
117
|
+
parentId?: string | undefined;
|
|
118
|
+
sortOrder: number;
|
|
119
|
+
isActive: boolean;
|
|
120
|
+
iconUrl?: string | undefined;
|
|
121
|
+
bannerUrl?: string | undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface DeleteCategoryResponse {
|
|
125
|
+
ok: boolean;
|
|
126
|
+
}
|
|
127
|
+
|
|
83
128
|
export interface EnumValue {
|
|
84
129
|
id: string;
|
|
85
130
|
value: string;
|
|
@@ -101,6 +146,12 @@ export interface CategoriesServiceClient {
|
|
|
101
146
|
getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
|
|
102
147
|
|
|
103
148
|
getCategoryAttributes(request: GetCategoryAttributesRequest): Observable<GetCategoryAttributesResponse>;
|
|
149
|
+
|
|
150
|
+
createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
|
|
151
|
+
|
|
152
|
+
updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
|
|
153
|
+
|
|
154
|
+
deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
|
|
104
155
|
}
|
|
105
156
|
|
|
106
157
|
export interface CategoriesServiceController {
|
|
@@ -115,11 +166,30 @@ export interface CategoriesServiceController {
|
|
|
115
166
|
getCategoryAttributes(
|
|
116
167
|
request: GetCategoryAttributesRequest,
|
|
117
168
|
): Promise<GetCategoryAttributesResponse> | Observable<GetCategoryAttributesResponse> | GetCategoryAttributesResponse;
|
|
169
|
+
|
|
170
|
+
createCategory(
|
|
171
|
+
request: CreateCategoryRequest,
|
|
172
|
+
): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
|
|
173
|
+
|
|
174
|
+
updateCategory(
|
|
175
|
+
request: UpdateCategoryRequest,
|
|
176
|
+
): Promise<UpdateCategoryResponse> | Observable<UpdateCategoryResponse> | UpdateCategoryResponse;
|
|
177
|
+
|
|
178
|
+
deleteCategory(
|
|
179
|
+
request: DeleteCategoryRequest,
|
|
180
|
+
): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
|
|
118
181
|
}
|
|
119
182
|
|
|
120
183
|
export function CategoriesServiceControllerMethods() {
|
|
121
184
|
return function (constructor: Function) {
|
|
122
|
-
const grpcMethods: string[] = [
|
|
185
|
+
const grpcMethods: string[] = [
|
|
186
|
+
"getAllCategories",
|
|
187
|
+
"getCategory",
|
|
188
|
+
"getCategoryAttributes",
|
|
189
|
+
"createCategory",
|
|
190
|
+
"updateCategory",
|
|
191
|
+
"deleteCategory",
|
|
192
|
+
];
|
|
123
193
|
for (const method of grpcMethods) {
|
|
124
194
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
125
195
|
GrpcMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/ad.proto
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package ad.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
7
|
+
service AdService {
|
|
8
|
+
rpc CreateAd (CreateAdRequest) returns (CreateAdResponse);
|
|
9
|
+
rpc GetAd (GetAdRequest) returns (GetAdResponse);
|
|
10
|
+
rpc UpdateAd (UpdateAdRequest) returns (UpdateAdResponse);
|
|
11
|
+
rpc DeleteAd (DeleteAdRequest) returns (DeleteAdResponse);
|
|
12
|
+
rpc ListAds (ListAdsRequest) returns (ListAdsResponse);
|
|
13
|
+
rpc GetMyAds (GetMyAdsRequest) returns (ListAdsResponse);
|
|
14
|
+
rpc PublishAd (PublishAdRequest) returns (PublishAdResponse);
|
|
15
|
+
rpc ArchiveAd (ArchiveAdRequest) returns (ArchiveAdResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
enum AdStatus {
|
|
19
|
+
AD_STATUS_UNSPECIFIED = 0;
|
|
20
|
+
AD_STATUS_DRAFT = 1;
|
|
21
|
+
AD_STATUS_MODERATION = 2;
|
|
22
|
+
AD_STATUS_ACTIVE = 3;
|
|
23
|
+
AD_STATUS_SOLD = 4;
|
|
24
|
+
AD_STATUS_ARCHIVED = 5;
|
|
25
|
+
AD_STATUS_REJECTED = 6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message CreateAdRequest {
|
|
29
|
+
string user_id = 1;
|
|
30
|
+
string category_id = 2;
|
|
31
|
+
string title = 3;
|
|
32
|
+
optional string description = 4;
|
|
33
|
+
double price = 5;
|
|
34
|
+
optional string currency = 6;
|
|
35
|
+
optional Location location = 7;
|
|
36
|
+
optional Attributes attributes = 8;
|
|
37
|
+
repeated string image_urls = 9;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message UpdateAdRequest {
|
|
41
|
+
string id = 1;
|
|
42
|
+
string user_id = 2;
|
|
43
|
+
optional string category_id = 3;
|
|
44
|
+
optional string title = 4;
|
|
45
|
+
optional string description = 5;
|
|
46
|
+
optional double price = 6;
|
|
47
|
+
optional string currency = 7;
|
|
48
|
+
optional Location location = 8;
|
|
49
|
+
optional Attributes attributes = 9;
|
|
50
|
+
repeated string image_urls = 10;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message GetAdRequest {
|
|
54
|
+
string id = 1;
|
|
55
|
+
optional string user_id = 2; // для проверки прав доступа
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message DeleteAdRequest {
|
|
59
|
+
string id = 1;
|
|
60
|
+
string user_id = 2;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message ListAdsRequest {
|
|
64
|
+
optional string category_id = 1;
|
|
65
|
+
optional string user_id = 2;
|
|
66
|
+
optional AdStatus status = 3;
|
|
67
|
+
int32 page = 4;
|
|
68
|
+
int32 page_size = 5;
|
|
69
|
+
optional double min_price = 6;
|
|
70
|
+
optional double max_price = 7;
|
|
71
|
+
optional string sort_by = 8; // "created_at", "price", "views"
|
|
72
|
+
optional string sort_order = 9; // "asc", "desc"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message GetMyAdsRequest {
|
|
76
|
+
string user_id = 1;
|
|
77
|
+
optional AdStatus status = 2;
|
|
78
|
+
int32 page = 3;
|
|
79
|
+
int32 page_size = 4;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message PublishAdRequest {
|
|
83
|
+
string id = 1;
|
|
84
|
+
string user_id = 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message ArchiveAdRequest {
|
|
88
|
+
string id = 1;
|
|
89
|
+
string user_id = 2;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message CreateAdResponse {
|
|
93
|
+
Ad ad = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message GetAdResponse {
|
|
97
|
+
Ad ad = 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
message UpdateAdResponse {
|
|
101
|
+
Ad ad = 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message DeleteAdResponse {
|
|
105
|
+
bool ok = 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message ListAdsResponse {
|
|
109
|
+
repeated Ad ads = 1;
|
|
110
|
+
int32 total = 2;
|
|
111
|
+
int32 page = 3;
|
|
112
|
+
int32 page_size = 4;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message PublishAdResponse {
|
|
116
|
+
Ad ad = 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message ArchiveAdResponse {
|
|
120
|
+
Ad ad = 1;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message Ad {
|
|
124
|
+
string id = 1;
|
|
125
|
+
string user_id = 2;
|
|
126
|
+
string category_id = 3;
|
|
127
|
+
string title = 4;
|
|
128
|
+
optional string description = 5;
|
|
129
|
+
double price = 6;
|
|
130
|
+
string currency = 7;
|
|
131
|
+
AdStatus status = 8;
|
|
132
|
+
optional Location location = 9;
|
|
133
|
+
optional Attributes attributes = 10;
|
|
134
|
+
repeated AdImage images = 11;
|
|
135
|
+
int32 views = 12;
|
|
136
|
+
int32 favorites = 13;
|
|
137
|
+
bool promoted = 14;
|
|
138
|
+
optional int64 promoted_until = 15;
|
|
139
|
+
int64 created_at = 16;
|
|
140
|
+
int64 updated_at = 17;
|
|
141
|
+
optional int64 published_at = 18;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
message AdImage {
|
|
145
|
+
string id = 1;
|
|
146
|
+
string url = 2;
|
|
147
|
+
int32 order = 3;
|
|
148
|
+
bool is_primary = 4;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
message Location {
|
|
152
|
+
double lat = 1;
|
|
153
|
+
double lng = 2;
|
|
154
|
+
optional string address = 3;
|
|
155
|
+
optional string city = 4;
|
|
156
|
+
optional string region = 5;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
message Attributes {
|
|
160
|
+
map<string, string> values = 1; // key-value пары атрибутов
|
|
161
|
+
}
|
|
162
|
+
|
package/proto/categories.proto
CHANGED
|
@@ -8,6 +8,10 @@ service CategoriesService {
|
|
|
8
8
|
rpc GetAllCategories (google.protobuf.Empty) returns (GetAllCategoriesResponse);
|
|
9
9
|
rpc GetCategory (GetCategoryRequest) returns (GetCategoryResponse);
|
|
10
10
|
rpc GetCategoryAttributes (GetCategoryAttributesRequest) returns (GetCategoryAttributesResponse);
|
|
11
|
+
|
|
12
|
+
rpc CreateCategory (CreateCategoryRequest) returns (CreateCategoryResponse);
|
|
13
|
+
rpc UpdateCategory (UpdateCategoryRequest) returns (UpdateCategoryResponse);
|
|
14
|
+
rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteCategoryResponse);
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
message GetCategoryRequest {
|
|
@@ -65,6 +69,51 @@ message CategoryAttribute {
|
|
|
65
69
|
repeated EnumValue enum_values = 13;
|
|
66
70
|
}
|
|
67
71
|
|
|
72
|
+
message CreateCategoryRequest {
|
|
73
|
+
string name = 1;
|
|
74
|
+
string slug = 2;
|
|
75
|
+
optional string description = 3;
|
|
76
|
+
optional string parent_id = 4;
|
|
77
|
+
int32 sort_order = 5;
|
|
78
|
+
bool is_active = 6;
|
|
79
|
+
optional string icon_url = 7;
|
|
80
|
+
optional string banner_url = 8;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
message CreateCategoryResponse {
|
|
84
|
+
bool ok = 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message UpdateCategoryRequest {
|
|
88
|
+
string name = 1;
|
|
89
|
+
string slug = 2;
|
|
90
|
+
optional string description = 3;
|
|
91
|
+
optional string parent_id = 4;
|
|
92
|
+
int32 sort_order = 5;
|
|
93
|
+
bool is_active = 6;
|
|
94
|
+
optional string icon_url = 7;
|
|
95
|
+
optional string banner_url = 8;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message UpdateCategoryResponse {
|
|
99
|
+
bool ok = 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message DeleteCategoryRequest {
|
|
103
|
+
string name = 1;
|
|
104
|
+
string slug = 2;
|
|
105
|
+
optional string description = 3;
|
|
106
|
+
optional string parent_id = 4;
|
|
107
|
+
int32 sort_order = 5;
|
|
108
|
+
bool is_active = 6;
|
|
109
|
+
optional string icon_url = 7;
|
|
110
|
+
optional string banner_url = 8;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
message DeleteCategoryResponse {
|
|
114
|
+
bool ok = 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
68
117
|
message EnumValue {
|
|
69
118
|
string id = 1;
|
|
70
119
|
string value = 2;
|