@tcinema-pro/contracts 1.3.9 → 1.4.0
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/screening.ts +130 -0
- package/package.json +1 -1
- package/proto/screening.proto +84 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -12,4 +12,5 @@ exports.PROTO_PATHS = {
|
|
|
12
12
|
THEATER: (0, path_1.join)(__dirname, '../../proto/theater.proto'),
|
|
13
13
|
HALL: (0, path_1.join)(__dirname, '../../proto/hall.proto'),
|
|
14
14
|
SEAT: (0, path_1.join)(__dirname, '../../proto/seat.proto'),
|
|
15
|
+
SCREENING: (0, path_1.join)(__dirname, '../../proto/screening.proto'),
|
|
15
16
|
};
|
package/gen/screening.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: screening.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "screening.v1";
|
|
13
|
+
|
|
14
|
+
export interface GetScreeningRequest {
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface GetScreeningResponse {
|
|
19
|
+
screening: Screening | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface GetScreeningsByMovieRequest {
|
|
23
|
+
movieId: string;
|
|
24
|
+
date?: Timestamp | undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface GetScreeningsByMovieResponse {
|
|
28
|
+
screening: Screening[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CreateScreeningRequest {
|
|
32
|
+
movieId: string;
|
|
33
|
+
hallId: string;
|
|
34
|
+
startAt: Timestamp | undefined;
|
|
35
|
+
endAt: Timestamp | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CreateScreeningResponse {
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface GetScreeningsRequest {
|
|
43
|
+
theaterId?: string | undefined;
|
|
44
|
+
date?: string | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface GetScreeningsResponse {
|
|
48
|
+
screening: Screening[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface Screening {
|
|
52
|
+
id: string;
|
|
53
|
+
startAt: Timestamp | undefined;
|
|
54
|
+
startEnd: Timestamp | undefined;
|
|
55
|
+
theater: Theater | undefined;
|
|
56
|
+
hall: Hall | undefined;
|
|
57
|
+
seatTypes: SeatType[];
|
|
58
|
+
movie: Movie | undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface Movie {
|
|
62
|
+
id: string;
|
|
63
|
+
title: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
duration: number;
|
|
66
|
+
banner: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface Theater {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
address: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface Hall {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface SeatType {
|
|
81
|
+
type: string;
|
|
82
|
+
price: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const SCREENING_V1_PACKAGE_NAME = "screening.v1";
|
|
86
|
+
|
|
87
|
+
export interface ScreeningServiceClient {
|
|
88
|
+
createScreening(request: CreateScreeningRequest): Observable<CreateScreeningResponse>;
|
|
89
|
+
|
|
90
|
+
getScreenings(request: GetScreeningsRequest): Observable<GetScreeningsResponse>;
|
|
91
|
+
|
|
92
|
+
getScreeningsByMovie(request: GetScreeningsByMovieRequest): Observable<GetScreeningsByMovieResponse>;
|
|
93
|
+
|
|
94
|
+
getScreening(request: GetScreeningRequest): Observable<GetScreeningResponse>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface ScreeningServiceController {
|
|
98
|
+
createScreening(
|
|
99
|
+
request: CreateScreeningRequest,
|
|
100
|
+
): Promise<CreateScreeningResponse> | Observable<CreateScreeningResponse> | CreateScreeningResponse;
|
|
101
|
+
|
|
102
|
+
getScreenings(
|
|
103
|
+
request: GetScreeningsRequest,
|
|
104
|
+
): Promise<GetScreeningsResponse> | Observable<GetScreeningsResponse> | GetScreeningsResponse;
|
|
105
|
+
|
|
106
|
+
getScreeningsByMovie(
|
|
107
|
+
request: GetScreeningsByMovieRequest,
|
|
108
|
+
): Promise<GetScreeningsByMovieResponse> | Observable<GetScreeningsByMovieResponse> | GetScreeningsByMovieResponse;
|
|
109
|
+
|
|
110
|
+
getScreening(
|
|
111
|
+
request: GetScreeningRequest,
|
|
112
|
+
): Promise<GetScreeningResponse> | Observable<GetScreeningResponse> | GetScreeningResponse;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function ScreeningServiceControllerMethods() {
|
|
116
|
+
return function (constructor: Function) {
|
|
117
|
+
const grpcMethods: string[] = ["createScreening", "getScreenings", "getScreeningsByMovie", "getScreening"];
|
|
118
|
+
for (const method of grpcMethods) {
|
|
119
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
120
|
+
GrpcMethod("ScreeningService", method)(constructor.prototype[method], method, descriptor);
|
|
121
|
+
}
|
|
122
|
+
const grpcStreamMethods: string[] = [];
|
|
123
|
+
for (const method of grpcStreamMethods) {
|
|
124
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
125
|
+
GrpcStreamMethod("ScreeningService", method)(constructor.prototype[method], method, descriptor);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const SCREENING_SERVICE_NAME = "ScreeningService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
syntax = 'proto3';
|
|
2
|
+
|
|
3
|
+
package screening.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
service ScreeningService {
|
|
8
|
+
rpc CreateScreening (CreateScreeningRequest) returns (CreateScreeningResponse);
|
|
9
|
+
rpc GetScreenings (GetScreeningsRequest) returns (GetScreeningsResponse);
|
|
10
|
+
rpc GetScreeningsByMovie (GetScreeningsByMovieRequest) returns (GetScreeningsByMovieResponse);
|
|
11
|
+
rpc GetScreening (GetScreeningRequest) returns (GetScreeningResponse);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message GetScreeningRequest {
|
|
15
|
+
string id = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message GetScreeningResponse {
|
|
19
|
+
Screening screening = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message GetScreeningsByMovieRequest {
|
|
23
|
+
string movie_id = 1;
|
|
24
|
+
optional google.protobuf.Timestamp date = 2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message GetScreeningsByMovieResponse {
|
|
28
|
+
repeated Screening screening = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message CreateScreeningRequest {
|
|
32
|
+
string movie_id = 1;
|
|
33
|
+
string hall_id = 2;
|
|
34
|
+
google.protobuf.Timestamp start_at = 3;
|
|
35
|
+
google.protobuf.Timestamp end_at = 4;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message CreateScreeningResponse {
|
|
39
|
+
bool ok = 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message GetScreeningsRequest {
|
|
43
|
+
optional string theater_id = 1;
|
|
44
|
+
optional string date = 2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message GetScreeningsResponse {
|
|
48
|
+
repeated Screening screening = 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message Screening {
|
|
52
|
+
string id = 1;
|
|
53
|
+
google.protobuf.Timestamp start_at = 2;
|
|
54
|
+
google.protobuf.Timestamp start_end = 3;
|
|
55
|
+
|
|
56
|
+
Theater theater = 4;
|
|
57
|
+
Hall hall = 5;
|
|
58
|
+
repeated SeatType seat_types = 6;
|
|
59
|
+
Movie movie = 7;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message Movie {
|
|
63
|
+
string id = 1;
|
|
64
|
+
string title = 2;
|
|
65
|
+
string slug = 3;
|
|
66
|
+
int32 duration = 4;
|
|
67
|
+
string banner = 5;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message Theater {
|
|
71
|
+
string id = 1;
|
|
72
|
+
string name = 2;
|
|
73
|
+
string address = 3;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message Hall {
|
|
77
|
+
string id = 1;
|
|
78
|
+
string name = 2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message SeatType {
|
|
82
|
+
string type = 1;
|
|
83
|
+
int32 price = 2;
|
|
84
|
+
}
|