-
Notifications
You must be signed in to change notification settings - Fork 0
/
activity-service.ts
76 lines (66 loc) · 1.7 KB
/
activity-service.ts
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
/* eslint-disable */
import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
import { Observable } from 'rxjs';
export const protobufPackage = 'activityservice';
export interface ActivityRequest {
id: string;
}
export interface ActivityResponse {
id: string;
offer: Offer[];
}
export interface Offer {
nid: string;
title: string;
pictUrl: string;
icons: Icon[];
}
export interface Icon {
type: string;
bgColor: string;
borderColor: string;
fontColor: string;
text: string;
source: string;
}
export const ACTIVITYSERVICE_PACKAGE_NAME = 'activityservice';
export interface ActivityServiceClient {
call(request: ActivityRequest): Observable<ActivityResponse>;
}
export interface ActivityServiceController {
call(
request: ActivityRequest,
):
| Promise<ActivityResponse>
| Observable<ActivityResponse>
| ActivityResponse;
}
export function ActivityServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = ['call'];
for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(
constructor.prototype,
method,
);
GrpcMethod('ActivityService', method)(
constructor.prototype[method],
method,
descriptor,
);
}
const grpcStreamMethods: string[] = [];
for (const method of grpcStreamMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(
constructor.prototype,
method,
);
GrpcStreamMethod('ActivityService', method)(
constructor.prototype[method],
method,
descriptor,
);
}
};
}
export const ACTIVITY_SERVICE_NAME = 'ActivityService';