diff --git a/cinema_db/cinema_db.yml b/cinema_db/cinema_db.yml index e015792..9a2b558 100644 --- a/cinema_db/cinema_db.yml +++ b/cinema_db/cinema_db.yml @@ -36,7 +36,6 @@ services: - 6432 networks: - cinema_db_network - - databases_network environment: POSTGRESQL_HOST: cinema_db_master PGBOUNCER_AUTH_TYPE: md5 diff --git a/internal/repository/cinemaRepository.go b/internal/repository/cinemaRepository.go index 5cccae9..270a386 100644 --- a/internal/repository/cinemaRepository.go +++ b/internal/repository/cinemaRepository.go @@ -186,8 +186,34 @@ func (r *cinemaRepository) GetMoviesScreeningsInCities(ctx context.Context, return res, nil } + +func (r *cinemaRepository) GetCityScreenings(ctx context.Context, + cityId, movieId int32, startPeriod, endPeriod time.Time) ([]CityScreening, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaRepository.GetCityScreenings") + defer span.Finish() + var err error + defer span.SetTag("error", err != nil) + + query := fmt.Sprintf(` + SELECT %[1]s.id, %[2]s.name AS screening_type, hall_id, ticket_price,start_time, cinema_id + FROM %[1]s JOIN %[2]s ON screening_type_id=%[2]s.id + JOIN %[3]s ON hall_id = %[3]s.id + JOIN %[4]s ON cinema_id = %[4]s.id + WHERE city_id=$1 AND movie_id=$2 AND start_time>=$3 AND start_time<=$4 + ORDER BY start_time;`, + screeningsTableName, screeningTypeTableName, hallsTableName, cinemasTableName) + + var screenings []CityScreening + err = r.db.SelectContext(ctx, &screenings, query, cityId, movieId, startPeriod, endPeriod) + if err != nil { + r.logger.Errorf("err: %v query: %s", err.Error(), query) + return []CityScreening{}, err + } + + return screenings, nil +} func (r *cinemaRepository) GetScreenings(ctx context.Context, - cinemaID, movieID int32, startPeriod, endPeriod time.Time) ([]Screening, error) { + cinemaID, movieID int32, startPeriod, endPeriod time.Time) (Screenings, error) { span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaRepository.GetScreenings") defer span.Finish() var err error @@ -197,18 +223,44 @@ func (r *cinemaRepository) GetScreenings(ctx context.Context, SELECT %[1]s.id, movie_id, %[2]s.name AS screening_type, hall_id, ticket_price,start_time FROM %[1]s JOIN %[2]s ON screening_type_id=%[2]s.id WHERE hall_id=ANY(SELECT id FROM %[3]s WHERE cinema_id=$1) AND movie_id=$2 AND start_time>=$3 AND start_time<=$4 - ORDER BY start_time`, + ORDER BY start_time;`, screeningsTableName, screeningTypeTableName, hallsTableName) - var screenings []Screening + var screenings []screening err = r.db.SelectContext(ctx, &screenings, query, cinemaID, movieID, startPeriod, endPeriod) if err != nil { r.logger.Errorf("err: %v query: %s", err.Error(), query) - return []Screening{}, err + return Screenings{}, err } - return screenings, nil + return Screenings{Screenings: screenings}, nil +} + +func (r *cinemaRepository) GetScreening(ctx context.Context, id int32) (Screening, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaRepository.GetScreening") + defer span.Finish() + var err error + defer span.SetTag("error", err != nil) + + query := fmt.Sprintf(` + SELECT %[2]s.name AS screening_type,hall_id,ticket_price,start_time,cinema_id,movie_id + FROM %[1]s JOIN %[2]s ON screening_type_id=%[2]s.id + JOIN %[3]s ON hall_id = %[3]s.id + WHERE %[1]s.id=$1;`, screeningsTableName, screeningTypeTableName, hallsTableName) + + var screening Screening + err = r.db.GetContext(ctx, &screening, query, id) + if errors.Is(err, sql.ErrNoRows) { + return Screening{}, ErrNotFound + } + if err != nil { + r.logger.Errorf("err: %v query: %s", err.Error(), query) + return Screening{}, err + } + + return screening, nil } + func (r *cinemaRepository) GetCinema(ctx context.Context, id int32) (Cinema, error) { span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaRepository.GetCinema") defer span.Finish() diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 471ce4b..3d53785 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -77,9 +77,9 @@ type Screening struct { ScreeningType string `json:"screening_type" db:"screening_type"` TicketPrice string `json:"ticket_price" db:"ticket_price"` StartTime time.Time `json:"start_time" db:"start_time"` - ScreeningID int64 `json:"id" db:"id"` - HallID int32 `json:"hall_id" db:"hall_id"` - MovieID int32 `json:"movie_id" db:"movie_id"` + HallId int32 `json:"hall_id" db:"hall_id"` + MovieId int32 `json:"movie_id" db:"movie_id"` + CinemaId int32 `json:"cinema_id" db:"cinema_id"` } type Place struct { @@ -89,7 +89,30 @@ type Place struct { GridPosY float32 `json:"grid_pos_y" db:"grid_pos_y"` } +type CityScreening struct { + ScreeningType string `json:"screening_type" db:"screening_type"` + TicketPrice string `json:"ticket_price" db:"ticket_price"` + StartTime time.Time `json:"start_time" db:"start_time"` + ScreeningId int64 `json:"id" db:"id"` + HallId int32 `json:"hall_id" db:"hall_id"` + CinemaId int32 `json:"cinema_id" db:"cinema_id"` +} + +type screening struct { + ScreeningType string `json:"screening_type" db:"screening_type"` + TicketPrice string `json:"ticket_price" db:"ticket_price"` + StartTime time.Time `json:"start_time" db:"start_time"` + ScreeningID int64 `json:"id" db:"id"` + HallID int32 `json:"hall_id" db:"hall_id"` + MovieID int32 `json:"movie_id" db:"movie_id"` +} + +type Screenings struct { + Screenings []screening +} + type CinemaRepository interface { + GetScreening(ctx context.Context, id int32) (Screening, error) // Returns cinemas in the city. GetCinemasInCity(ctx context.Context, id int32) ([]Cinema, error) @@ -99,6 +122,9 @@ type CinemaRepository interface { // Returns all movies that are in the cinema screenings in a particular cinema. GetMoviesScreenings(ctx context.Context, cinemaID int32, startPeriod, endPeriod time.Time) ([]MoviesScreenings, error) + // Returns all screenings for a movie in a specific city. + GetCityScreenings(ctx context.Context, cityId, movieId int32, startPeriod, endPeriod time.Time) ([]CityScreening, error) + // Returns all movies that are in the cinema screenings. GetAllMoviesScreenings(ctx context.Context, startPeriod, endPeriod time.Time) ([]MoviesScreenings, error) @@ -106,7 +132,7 @@ type CinemaRepository interface { GetMoviesScreeningsInCities(ctx context.Context, citiesIds []int32, startPeriod, endPeriod time.Time) ([]MoviesScreenings, error) //Returns all screenings for a movie in a specific cinema. - GetScreenings(ctx context.Context, cinemaID, movieID int32, startPeriod, endPeriod time.Time) ([]Screening, error) + GetScreenings(ctx context.Context, cinemaID, movieID int32, startPeriod, endPeriod time.Time) (Screenings, error) // Returns the configuration of the hall. GetHallConfiguraion(ctx context.Context, id int32) ([]Place, error) diff --git a/internal/service/repositoryWrapper.go b/internal/service/repositoryWrapper.go index f7547d6..34eca52 100644 --- a/internal/service/repositoryWrapper.go +++ b/internal/service/repositoryWrapper.go @@ -3,6 +3,7 @@ package service import ( "context" "errors" + "fmt" "strconv" "strings" "time" @@ -169,13 +170,13 @@ func (w *cinemaRepositoryWrapper) GetScreenings(ctx context.Context, cinemaID, m if err != nil { return nil, w.createErrorResponceWithSpan(span, ErrInternal, err.Error()) } - if len(screenings) == 0 { + if len(screenings.Screenings) == 0 { return nil, w.createErrorResponceWithSpan(span, ErrNotFound, "") } res := &cinema_service.Screenings{} - res.Screenings = make([]*cinema_service.Screening, len(screenings)) - for i, screening := range screenings { + res.Screenings = make([]*cinema_service.Screening, len(screenings.Screenings)) + for i, screening := range screenings.Screenings { res.Screenings[i] = &cinema_service.Screening{ ScreeningID: screening.ScreeningID, ScreeningType: screening.ScreeningType, @@ -189,6 +190,65 @@ func (w *cinemaRepositoryWrapper) GetScreenings(ctx context.Context, cinemaID, m return res, nil } +func (w *cinemaRepositoryWrapper) GetCityScreenings(ctx context.Context, cityID, movieID int32, + startPeriod, endPeriod time.Time) (*cinema_service.CityScreenings, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, + "cinemaRepositoryWrapper.GetCityScreenings") + defer span.Finish() + + screenings, err := w.repo.GetCityScreenings(ctx, cityID, movieID, + startPeriod, endPeriod) + if err != nil { + return nil, w.createErrorResponceWithSpan(span, ErrInternal, err.Error()) + } + if len(screenings) == 0 { + return nil, w.createErrorResponceWithSpan(span, ErrNotFound, "") + } + + res := &cinema_service.CityScreenings{} + res.Screenings = make([]*cinema_service.CityScreening, len(screenings)) + for i, screening := range screenings { + res.Screenings[i] = &cinema_service.CityScreening{ + ScreeningId: screening.ScreeningId, + CinemaId: screening.CinemaId, + ScreeningType: screening.ScreeningType, + HallID: screening.HallId, + StartTime: &cinema_service.Timestamp{FormattedTimestamp: screening.StartTime.Format(time.RFC3339)}, + TicketPrice: priceFromFloat(screening.TicketPrice), + } + } + + return res, nil +} + +func (w *cinemaRepositoryWrapper) GetScreening(ctx context.Context, id int32) (*cinema_service.GetScreeningResponse, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaRepositoryWrapper.GetScreening") + defer span.Finish() + + screening, err := w.repo.GetScreening(ctx, id) + if errors.Is(err, repository.ErrNotFound) { + return nil, w.createErrorResponceWithSpan(span, ErrNotFound, fmt.Sprintf("screening with %d id not found", id)) + } + if err != nil { + return nil, w.createErrorResponceWithSpan(span, ErrInternal, err.Error()) + } + + res := &cinema_service.GetScreeningResponse{ + ScreeningType: screening.ScreeningType, + CinemaId: screening.CinemaId, + MovieId: screening.MovieId, + HallID: screening.HallId, + StartTime: &cinema_service.Timestamp{FormattedTimestamp: screening.StartTime.Format(time.RFC3339)}, + TicketPrice: priceFromFloat(screening.TicketPrice), + } + + res.HallConfiguration, err = w.GetHallConfiguraion(ctx, res.HallID) + if err != nil { + return nil, w.createErrorResponceWithSpan(span, ErrInternal, err.Error()) + } + return res, nil +} + func (w *cinemaRepositoryWrapper) GetCinema(ctx context.Context, id int32) (*cinema_service.Cinema, error) { span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaRepositoryWrapper.GetCinema") defer span.Finish() diff --git a/internal/service/service.go b/internal/service/service.go index f57c075..b7d81a1 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -27,27 +27,31 @@ type CinemaRepository interface { startPeriod, endPeriod time.Time) (*cinema_service.PreviewScreenings, error) GetScreenings(ctx context.Context, cinemaID, movieID int32, startPeriod, endPeriod time.Time) (*cinema_service.Screenings, error) + GetCityScreenings(ctx context.Context, cityID, movieID int32, + startPeriod, endPeriod time.Time) (*cinema_service.CityScreenings, error) GetCinemasCities(ctx context.Context) (*cinema_service.Cities, error) GetCinema(ctx context.Context, id int32) (*cinema_service.Cinema, error) GetHallConfiguraion(ctx context.Context, id int32) (*cinema_service.HallConfiguration, error) GetHalls(ctx context.Context, ids []int32) (*cinema_service.Halls, error) + + GetScreening(ctx context.Context, id int32) (*cinema_service.GetScreeningResponse, error) } -type cinemaService struct { +type CinemaService struct { cinema_service.UnimplementedCinemaServiceV1Server logger *logrus.Logger cinemaRepo CinemaRepository errorHandler errorHandler } -func NewCinemaService(logger *logrus.Logger, cinemaRepo CinemaRepository) *cinemaService { +func NewCinemaService(logger *logrus.Logger, cinemaRepo CinemaRepository) *CinemaService { errorHandler := newErrorHandler(logger) - return &cinemaService{logger: logger, errorHandler: errorHandler, cinemaRepo: cinemaRepo} + return &CinemaService{logger: logger, errorHandler: errorHandler, cinemaRepo: cinemaRepo} } -func (s *cinemaService) GetCinemasInCity(ctx context.Context, +func (s *CinemaService) GetCinemasInCity(ctx context.Context, in *cinema_service.GetCinemasInCityRequest) (*cinema_service.Cinemas, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetCinemasInCity") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetCinemasInCity") defer span.Finish() res, err := s.cinemaRepo.GetCinemasInCity(ctx, in.CityId) @@ -65,9 +69,9 @@ func (s *cinemaService) GetCinemasInCity(ctx context.Context, return res, nil } -func (s *cinemaService) GetMoviesScreenings(ctx context.Context, +func (s *CinemaService) GetMoviesScreenings(ctx context.Context, in *cinema_service.GetMoviesScreeningsRequest) (*cinema_service.PreviewScreenings, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetMoviesScreenings") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetMoviesScreenings") defer span.Finish() start, end, err := parsePeriods(in.StartPeriod, in.EndPeriod) @@ -85,9 +89,9 @@ func (s *cinemaService) GetMoviesScreenings(ctx context.Context, return res, nil } -func (s *cinemaService) GetMoviesScreeningsInCities(ctx context.Context, +func (s *CinemaService) GetMoviesScreeningsInCities(ctx context.Context, in *cinema_service.GetMoviesScreeningsInCitiesRequest) (*cinema_service.PreviewScreenings, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetMoviesScreeningsInCities") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetMoviesScreeningsInCities") defer span.Finish() start, end, err := parsePeriods(in.StartPeriod, in.EndPeriod) @@ -127,9 +131,9 @@ func convertStringsSlice(str []string) []int32 { return nums } -func (s *cinemaService) GetScreenings(ctx context.Context, +func (s *CinemaService) GetScreenings(ctx context.Context, in *cinema_service.GetScreeningsRequest) (*cinema_service.Screenings, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetScreenings") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetScreenings") defer span.Finish() start, end, err := parsePeriods(in.StartPeriod, in.EndPeriod) if err != nil { @@ -147,9 +151,45 @@ func (s *cinemaService) GetScreenings(ctx context.Context, return res, nil } -func (s *cinemaService) GetCinemasCities(ctx context.Context, +func (s *CinemaService) GetScreeningsInCity(ctx context.Context, + in *cinema_service.GetScreeningsInCityRequest) (*cinema_service.CityScreenings, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetScreeningsInCity") + defer span.Finish() + start, end, err := parsePeriods(in.StartPeriod, in.EndPeriod) + if err != nil { + return nil, s.errorHandler.createErrorResponceWithSpan(span, ErrInvalidArgument, err.Error()) + } + + res, err := s.cinemaRepo.GetCityScreenings(ctx, in.CityId, in.MovieId, start, end) + if err != nil { + ext.LogError(span, err) + span.SetTag("grpc.status", status.Code(err)) + return nil, err + } + + span.SetTag("grpc.status", codes.OK) + return res, nil +} + +func (s *CinemaService) GetScreening(ctx context.Context, + in *cinema_service.GetScreeningRequest) (*cinema_service.GetScreeningResponse, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetScreening") + defer span.Finish() + + res, err := s.cinemaRepo.GetScreening(ctx, in.ScreeningId) + if err != nil { + ext.LogError(span, err) + span.SetTag("grpc.status", status.Code(err)) + return nil, err + } + + span.SetTag("grpc.status", codes.OK) + return res, nil +} + +func (s *CinemaService) GetCinemasCities(ctx context.Context, in *emptypb.Empty) (*cinema_service.Cities, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetCinemasCities") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetCinemasCities") defer span.Finish() res, err := s.cinemaRepo.GetCinemasCities(ctx) @@ -162,9 +202,9 @@ func (s *cinemaService) GetCinemasCities(ctx context.Context, return res, nil } -func (s *cinemaService) GetHallConfiguration(ctx context.Context, +func (s *CinemaService) GetHallConfiguration(ctx context.Context, in *cinema_service.GetHallConfigurationRequest) (*cinema_service.HallConfiguration, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetHallConfiguration") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetHallConfiguration") defer span.Finish() res, err := s.cinemaRepo.GetHallConfiguraion(ctx, in.HallId) if err != nil { @@ -176,9 +216,9 @@ func (s *cinemaService) GetHallConfiguration(ctx context.Context, return res, nil } -func (s *cinemaService) GetCinema(ctx context.Context, +func (s *CinemaService) GetCinema(ctx context.Context, in *cinema_service.GetCinemaRequest) (*cinema_service.Cinema, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetCinema") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetCinema") defer span.Finish() cinema, err := s.cinemaRepo.GetCinema(ctx, in.CinemaId) @@ -191,9 +231,9 @@ func (s *cinemaService) GetCinema(ctx context.Context, span.SetTag("grpc.status", codes.OK) return cinema, nil } -func (s *cinemaService) GetHalls(ctx context.Context, +func (s *CinemaService) GetHalls(ctx context.Context, in *cinema_service.GetHallsRequest) (*cinema_service.Halls, error) { - span, ctx := opentracing.StartSpanFromContext(ctx, "cinemaService.GetHalls") + span, ctx := opentracing.StartSpanFromContext(ctx, "CinemaService.GetHalls") defer span.Finish() in.HallsIds = strings.ReplaceAll(in.HallsIds, `"`, "") diff --git a/pkg/cinema_service/v1/protos/cinema_service_v1.pb.go b/pkg/cinema_service/v1/protos/cinema_service_v1.pb.go index f9014fa..aa417b0 100644 --- a/pkg/cinema_service/v1/protos/cinema_service_v1.pb.go +++ b/pkg/cinema_service/v1/protos/cinema_service_v1.pb.go @@ -36,7 +36,7 @@ var file_cinema_service_v1_proto_rawDesc = []byte{ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xd7, 0x09, 0x0a, 0x0f, 0x63, 0x69, 0x6e, 0x65, 0x6d, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb0, 0x0c, 0x0a, 0x0f, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x31, 0x12, 0x56, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x73, 0x43, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, @@ -57,121 +57,150 @@ var file_cinema_service_v1_proto_rawDesc = []byte{ 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x2f, 0x7b, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, - 0x49, 0x64, 0x7d, 0x12, 0xe3, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x76, 0x69, 0x65, - 0x73, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2a, 0x2e, 0x63, 0x69, - 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, - 0x4d, 0x6f, 0x76, 0x69, 0x65, 0x73, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, - 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x7d, 0x92, 0x41, 0x4b, 0x4a, - 0x49, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x42, 0x0a, 0x40, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x6f, - 0x72, 0x20, 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x69, 0x73, 0x20, - 0x6e, 0x6f, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, - 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x2f, 0x7b, 0x63, 0x69, - 0x6e, 0x65, 0x6d, 0x61, 0x49, 0x64, 0x7d, 0x2f, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x73, 0x12, 0xef, 0x01, 0x0a, 0x1b, 0x47, 0x65, + 0x49, 0x64, 0x7d, 0x12, 0x7f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, + 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, + 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, + 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x72, 0x65, + 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, + 0x67, 0x49, 0x64, 0x7d, 0x12, 0xe3, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x76, 0x69, + 0x65, 0x73, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2a, 0x2e, 0x63, + 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x76, 0x69, 0x65, 0x73, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, - 0x73, 0x49, 0x6e, 0x43, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x69, 0x6e, 0x65, - 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, - 0x76, 0x69, 0x65, 0x73, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, - 0x43, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, - 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, - 0x22, 0x79, 0x92, 0x41, 0x59, 0x4a, 0x57, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x50, 0x0a, 0x4e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, + 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, + 0x77, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x7d, 0x92, 0x41, 0x4b, + 0x4a, 0x49, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x42, 0x0a, 0x40, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, + 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x69, 0x73, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x2f, 0x7b, 0x63, + 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x49, 0x64, 0x7d, 0x2f, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, + 0x6e, 0x67, 0x73, 0x2f, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x73, 0x12, 0xef, 0x01, 0x0a, 0x1b, 0x47, + 0x65, 0x74, 0x4d, 0x6f, 0x76, 0x69, 0x65, 0x73, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, + 0x67, 0x73, 0x49, 0x6e, 0x43, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x69, 0x6e, + 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4d, + 0x6f, 0x76, 0x69, 0x65, 0x73, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x49, + 0x6e, 0x43, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, + 0x73, 0x22, 0x79, 0x92, 0x41, 0x59, 0x4a, 0x57, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x50, 0x0a, + 0x4e, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x69, 0x74, 0x69, 0x65, 0x73, 0x5f, 0x69, 0x64, + 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x72, 0x65, 0x65, + 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x73, 0x12, 0xd5, 0x01, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, + 0x43, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, + 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x43, 0x69, 0x74, 0x79, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, + 0x22, 0x72, 0x92, 0x41, 0x4b, 0x4a, 0x49, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x42, 0x0a, 0x40, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x69, 0x74, 0x69, 0x65, 0x73, 0x5f, 0x69, 0x64, 0x73, - 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, - 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x08, 0x47, - 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x1f, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, - 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x22, - 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x61, 0x6c, - 0x6c, 0x73, 0x12, 0xc9, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, - 0x69, 0x6e, 0x67, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, - 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x63, 0x69, 0x6e, - 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x63, 0x72, 0x65, - 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x76, 0x92, 0x41, 0x4b, 0x4a, 0x49, 0x0a, 0x03, 0x34, - 0x30, 0x30, 0x12, 0x42, 0x0a, 0x40, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, - 0x68, 0x65, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x6e, - 0x64, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x2f, 0x7b, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, - 0x49, 0x64, 0x7d, 0x2f, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x8f, - 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, - 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x61, 0x6c, 0x6c, 0x2f, 0x7b, 0x68, 0x61, 0x6c, 0x6c, 0x49, - 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0xac, 0x02, 0x5a, 0x18, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x92, 0x41, 0x8e, - 0x02, 0x12, 0x56, 0x0a, 0x0e, 0x43, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x07, 0x46, 0x61, 0x6c, 0x6f, 0x6b, 0x75, 0x74, 0x12, 0x1a, - 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x46, 0x61, 0x6c, 0x6f, 0x6b, 0x75, 0x74, 0x1a, 0x18, 0x74, 0x69, 0x6d, 0x75, - 0x72, 0x2e, 0x73, 0x69, 0x6e, 0x65, 0x6c, 0x6e, 0x69, 0x6b, 0x40, 0x79, 0x61, 0x6e, 0x64, 0x65, - 0x78, 0x2e, 0x72, 0x75, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x01, 0x01, 0x32, 0x10, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, - 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x49, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, 0x1b, 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, - 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x3b, 0x0a, 0x03, 0x35, 0x30, 0x30, 0x12, 0x34, 0x0a, 0x15, 0x53, 0x6f, 0x6d, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x72, 0x6f, 0x6e, - 0x67, 0x2e, 0x12, 0x1b, 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x69, 0x74, 0x79, + 0x2f, 0x7b, 0x63, 0x69, 0x74, 0x79, 0x49, 0x64, 0x7d, 0x2f, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x73, + 0x12, 0x1f, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, + 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0xc9, 0x01, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x24, 0x2e, + 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x22, + 0x76, 0x92, 0x41, 0x4b, 0x4a, 0x49, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x42, 0x0a, 0x40, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x69, 0x6e, 0x65, 0x6d, + 0x61, 0x2f, 0x7b, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x49, 0x64, 0x7d, 0x2f, 0x73, 0x63, 0x72, + 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x48, + 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x2b, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, + 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x61, + 0x6c, 0x6c, 0x2f, 0x7b, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xac, 0x02, 0x5a, 0x18, 0x63, 0x69, + 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x92, 0x41, 0x8e, 0x02, 0x12, 0x56, 0x0a, 0x0e, 0x43, 0x69, + 0x6e, 0x65, 0x6d, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x07, + 0x46, 0x61, 0x6c, 0x6f, 0x6b, 0x75, 0x74, 0x12, 0x1a, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, + 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x46, 0x61, 0x6c, 0x6f, + 0x6b, 0x75, 0x74, 0x1a, 0x18, 0x74, 0x69, 0x6d, 0x75, 0x72, 0x2e, 0x73, 0x69, 0x6e, 0x65, 0x6c, + 0x6e, 0x69, 0x6b, 0x40, 0x79, 0x61, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x72, 0x75, 0x32, 0x03, 0x31, + 0x2e, 0x30, 0x2a, 0x01, 0x01, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x34, + 0x12, 0x49, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, + 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, + 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, 0x1b, + 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x3b, 0x0a, 0x03, 0x35, + 0x30, 0x30, 0x12, 0x34, 0x0a, 0x15, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, + 0x77, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x72, 0x6f, 0x6e, 0x67, 0x2e, 0x12, 0x1b, 0x0a, 0x19, 0x1a, + 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, + 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_cinema_service_v1_proto_goTypes = []interface{}{ (*emptypb.Empty)(nil), // 0: google.protobuf.Empty (*GetCinemasInCityRequest)(nil), // 1: cinema_service.GetCinemasInCityRequest (*GetCinemaRequest)(nil), // 2: cinema_service.GetCinemaRequest - (*GetMoviesScreeningsRequest)(nil), // 3: cinema_service.GetMoviesScreeningsRequest - (*GetMoviesScreeningsInCitiesRequest)(nil), // 4: cinema_service.GetMoviesScreeningsInCitiesRequest - (*GetHallsRequest)(nil), // 5: cinema_service.GetHallsRequest - (*GetScreeningsRequest)(nil), // 6: cinema_service.GetScreeningsRequest - (*GetHallConfigurationRequest)(nil), // 7: cinema_service.GetHallConfigurationRequest - (*Cities)(nil), // 8: cinema_service.Cities - (*Cinemas)(nil), // 9: cinema_service.Cinemas - (*Cinema)(nil), // 10: cinema_service.Cinema - (*PreviewScreenings)(nil), // 11: cinema_service.PreviewScreenings - (*Halls)(nil), // 12: cinema_service.Halls - (*Screenings)(nil), // 13: cinema_service.Screenings - (*HallConfiguration)(nil), // 14: cinema_service.HallConfiguration + (*GetScreeningRequest)(nil), // 3: cinema_service.GetScreeningRequest + (*GetMoviesScreeningsRequest)(nil), // 4: cinema_service.GetMoviesScreeningsRequest + (*GetMoviesScreeningsInCitiesRequest)(nil), // 5: cinema_service.GetMoviesScreeningsInCitiesRequest + (*GetScreeningsInCityRequest)(nil), // 6: cinema_service.GetScreeningsInCityRequest + (*GetHallsRequest)(nil), // 7: cinema_service.GetHallsRequest + (*GetScreeningsRequest)(nil), // 8: cinema_service.GetScreeningsRequest + (*GetHallConfigurationRequest)(nil), // 9: cinema_service.GetHallConfigurationRequest + (*Cities)(nil), // 10: cinema_service.Cities + (*Cinemas)(nil), // 11: cinema_service.Cinemas + (*Cinema)(nil), // 12: cinema_service.Cinema + (*GetScreeningResponse)(nil), // 13: cinema_service.GetScreeningResponse + (*PreviewScreenings)(nil), // 14: cinema_service.PreviewScreenings + (*CityScreenings)(nil), // 15: cinema_service.CityScreenings + (*Halls)(nil), // 16: cinema_service.Halls + (*Screenings)(nil), // 17: cinema_service.Screenings + (*HallConfiguration)(nil), // 18: cinema_service.HallConfiguration } var file_cinema_service_v1_proto_depIdxs = []int32{ 0, // 0: cinema_service.cinemaServiceV1.GetCinemasCities:input_type -> google.protobuf.Empty 1, // 1: cinema_service.cinemaServiceV1.GetCinemasInCity:input_type -> cinema_service.GetCinemasInCityRequest 2, // 2: cinema_service.cinemaServiceV1.GetCinema:input_type -> cinema_service.GetCinemaRequest - 3, // 3: cinema_service.cinemaServiceV1.GetMoviesScreenings:input_type -> cinema_service.GetMoviesScreeningsRequest - 4, // 4: cinema_service.cinemaServiceV1.GetMoviesScreeningsInCities:input_type -> cinema_service.GetMoviesScreeningsInCitiesRequest - 5, // 5: cinema_service.cinemaServiceV1.GetHalls:input_type -> cinema_service.GetHallsRequest - 6, // 6: cinema_service.cinemaServiceV1.GetScreenings:input_type -> cinema_service.GetScreeningsRequest - 7, // 7: cinema_service.cinemaServiceV1.GetHallConfiguration:input_type -> cinema_service.GetHallConfigurationRequest - 8, // 8: cinema_service.cinemaServiceV1.GetCinemasCities:output_type -> cinema_service.Cities - 9, // 9: cinema_service.cinemaServiceV1.GetCinemasInCity:output_type -> cinema_service.Cinemas - 10, // 10: cinema_service.cinemaServiceV1.GetCinema:output_type -> cinema_service.Cinema - 11, // 11: cinema_service.cinemaServiceV1.GetMoviesScreenings:output_type -> cinema_service.PreviewScreenings - 11, // 12: cinema_service.cinemaServiceV1.GetMoviesScreeningsInCities:output_type -> cinema_service.PreviewScreenings - 12, // 13: cinema_service.cinemaServiceV1.GetHalls:output_type -> cinema_service.Halls - 13, // 14: cinema_service.cinemaServiceV1.GetScreenings:output_type -> cinema_service.Screenings - 14, // 15: cinema_service.cinemaServiceV1.GetHallConfiguration:output_type -> cinema_service.HallConfiguration - 8, // [8:16] is the sub-list for method output_type - 0, // [0:8] is the sub-list for method input_type + 3, // 3: cinema_service.cinemaServiceV1.GetScreening:input_type -> cinema_service.GetScreeningRequest + 4, // 4: cinema_service.cinemaServiceV1.GetMoviesScreenings:input_type -> cinema_service.GetMoviesScreeningsRequest + 5, // 5: cinema_service.cinemaServiceV1.GetMoviesScreeningsInCities:input_type -> cinema_service.GetMoviesScreeningsInCitiesRequest + 6, // 6: cinema_service.cinemaServiceV1.GetScreeningsInCity:input_type -> cinema_service.GetScreeningsInCityRequest + 7, // 7: cinema_service.cinemaServiceV1.GetHalls:input_type -> cinema_service.GetHallsRequest + 8, // 8: cinema_service.cinemaServiceV1.GetScreenings:input_type -> cinema_service.GetScreeningsRequest + 9, // 9: cinema_service.cinemaServiceV1.GetHallConfiguration:input_type -> cinema_service.GetHallConfigurationRequest + 10, // 10: cinema_service.cinemaServiceV1.GetCinemasCities:output_type -> cinema_service.Cities + 11, // 11: cinema_service.cinemaServiceV1.GetCinemasInCity:output_type -> cinema_service.Cinemas + 12, // 12: cinema_service.cinemaServiceV1.GetCinema:output_type -> cinema_service.Cinema + 13, // 13: cinema_service.cinemaServiceV1.GetScreening:output_type -> cinema_service.GetScreeningResponse + 14, // 14: cinema_service.cinemaServiceV1.GetMoviesScreenings:output_type -> cinema_service.PreviewScreenings + 14, // 15: cinema_service.cinemaServiceV1.GetMoviesScreeningsInCities:output_type -> cinema_service.PreviewScreenings + 15, // 16: cinema_service.cinemaServiceV1.GetScreeningsInCity:output_type -> cinema_service.CityScreenings + 16, // 17: cinema_service.cinemaServiceV1.GetHalls:output_type -> cinema_service.Halls + 17, // 18: cinema_service.cinemaServiceV1.GetScreenings:output_type -> cinema_service.Screenings + 18, // 19: cinema_service.cinemaServiceV1.GetHallConfiguration:output_type -> cinema_service.HallConfiguration + 10, // [10:20] is the sub-list for method output_type + 0, // [0:10] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/pkg/cinema_service/v1/protos/cinema_service_v1.pb.gw.go b/pkg/cinema_service/v1/protos/cinema_service_v1.pb.gw.go index 83821f0..6f16060 100644 --- a/pkg/cinema_service/v1/protos/cinema_service_v1.pb.gw.go +++ b/pkg/cinema_service/v1/protos/cinema_service_v1.pb.gw.go @@ -154,6 +154,58 @@ func local_request_CinemaServiceV1_GetCinema_0(ctx context.Context, marshaler ru } +func request_CinemaServiceV1_GetScreening_0(ctx context.Context, marshaler runtime.Marshaler, client CinemaServiceV1Client, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetScreeningRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["screeningId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "screeningId") + } + + protoReq.ScreeningId, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "screeningId", err) + } + + msg, err := client.GetScreening(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CinemaServiceV1_GetScreening_0(ctx context.Context, marshaler runtime.Marshaler, server CinemaServiceV1Server, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetScreeningRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["screeningId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "screeningId") + } + + protoReq.ScreeningId, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "screeningId", err) + } + + msg, err := server.GetScreening(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_CinemaServiceV1_GetMoviesScreenings_0 = &utilities.DoubleArray{Encoding: map[string]int{"cinemaId": 0, "cinema_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) @@ -260,6 +312,76 @@ func local_request_CinemaServiceV1_GetMoviesScreeningsInCities_0(ctx context.Con } +var ( + filter_CinemaServiceV1_GetScreeningsInCity_0 = &utilities.DoubleArray{Encoding: map[string]int{"cityId": 0, "city_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_CinemaServiceV1_GetScreeningsInCity_0(ctx context.Context, marshaler runtime.Marshaler, client CinemaServiceV1Client, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetScreeningsInCityRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cityId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cityId") + } + + protoReq.CityId, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cityId", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CinemaServiceV1_GetScreeningsInCity_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetScreeningsInCity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CinemaServiceV1_GetScreeningsInCity_0(ctx context.Context, marshaler runtime.Marshaler, server CinemaServiceV1Server, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetScreeningsInCityRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["cityId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cityId") + } + + protoReq.CityId, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cityId", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CinemaServiceV1_GetScreeningsInCity_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetScreeningsInCity(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_CinemaServiceV1_GetHalls_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -499,6 +621,31 @@ func RegisterCinemaServiceV1HandlerServer(ctx context.Context, mux *runtime.Serv }) + mux.Handle("GET", pattern_CinemaServiceV1_GetScreening_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/cinema_service.CinemaServiceV1/GetScreening", runtime.WithHTTPPathPattern("/v1/screenings/{screeningId}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CinemaServiceV1_GetScreening_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_CinemaServiceV1_GetScreening_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_CinemaServiceV1_GetMoviesScreenings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -549,6 +696,31 @@ func RegisterCinemaServiceV1HandlerServer(ctx context.Context, mux *runtime.Serv }) + mux.Handle("GET", pattern_CinemaServiceV1_GetScreeningsInCity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/cinema_service.CinemaServiceV1/GetScreeningsInCity", runtime.WithHTTPPathPattern("/v1/city/{cityId}/screenings")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CinemaServiceV1_GetScreeningsInCity_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_CinemaServiceV1_GetScreeningsInCity_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_CinemaServiceV1_GetHalls_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -731,6 +903,28 @@ func RegisterCinemaServiceV1HandlerClient(ctx context.Context, mux *runtime.Serv }) + mux.Handle("GET", pattern_CinemaServiceV1_GetScreening_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/cinema_service.CinemaServiceV1/GetScreening", runtime.WithHTTPPathPattern("/v1/screenings/{screeningId}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CinemaServiceV1_GetScreening_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_CinemaServiceV1_GetScreening_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_CinemaServiceV1_GetMoviesScreenings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -775,6 +969,28 @@ func RegisterCinemaServiceV1HandlerClient(ctx context.Context, mux *runtime.Serv }) + mux.Handle("GET", pattern_CinemaServiceV1_GetScreeningsInCity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/cinema_service.CinemaServiceV1/GetScreeningsInCity", runtime.WithHTTPPathPattern("/v1/city/{cityId}/screenings")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CinemaServiceV1_GetScreeningsInCity_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_CinemaServiceV1_GetScreeningsInCity_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_CinemaServiceV1_GetHalls_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -851,10 +1067,14 @@ var ( pattern_CinemaServiceV1_GetCinema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "cinema", "cinemaId"}, "")) + pattern_CinemaServiceV1_GetScreening_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "screenings", "screeningId"}, "")) + pattern_CinemaServiceV1_GetMoviesScreenings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "cinema", "cinemaId", "screenings", "movies"}, "")) pattern_CinemaServiceV1_GetMoviesScreeningsInCities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "screenings", "movies"}, "")) + pattern_CinemaServiceV1_GetScreeningsInCity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "city", "cityId", "screenings"}, "")) + pattern_CinemaServiceV1_GetHalls_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "halls"}, "")) pattern_CinemaServiceV1_GetScreenings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "cinema", "cinemaId", "screenings"}, "")) @@ -869,10 +1089,14 @@ var ( forward_CinemaServiceV1_GetCinema_0 = runtime.ForwardResponseMessage + forward_CinemaServiceV1_GetScreening_0 = runtime.ForwardResponseMessage + forward_CinemaServiceV1_GetMoviesScreenings_0 = runtime.ForwardResponseMessage forward_CinemaServiceV1_GetMoviesScreeningsInCities_0 = runtime.ForwardResponseMessage + forward_CinemaServiceV1_GetScreeningsInCity_0 = runtime.ForwardResponseMessage + forward_CinemaServiceV1_GetHalls_0 = runtime.ForwardResponseMessage forward_CinemaServiceV1_GetScreenings_0 = runtime.ForwardResponseMessage diff --git a/pkg/cinema_service/v1/protos/cinema_service_v1_grpc.pb.go b/pkg/cinema_service/v1/protos/cinema_service_v1_grpc.pb.go index a0e295c..9e749ad 100644 --- a/pkg/cinema_service/v1/protos/cinema_service_v1_grpc.pb.go +++ b/pkg/cinema_service/v1/protos/cinema_service_v1_grpc.pb.go @@ -29,10 +29,14 @@ type CinemaServiceV1Client interface { GetCinemasInCity(ctx context.Context, in *GetCinemasInCityRequest, opts ...grpc.CallOption) (*Cinemas, error) // Returns cinema with specified id. GetCinema(ctx context.Context, in *GetCinemaRequest, opts ...grpc.CallOption) (*Cinema, error) + // Returns info about screening. + GetScreening(ctx context.Context, in *GetScreeningRequest, opts ...grpc.CallOption) (*GetScreeningResponse, error) // Returns all movies that are in the cinema screenings in a particular cinema. GetMoviesScreenings(ctx context.Context, in *GetMoviesScreeningsRequest, opts ...grpc.CallOption) (*PreviewScreenings, error) // Returns all movies screenings in the cinema screenings in specified cities, or in all cities, if not specified. GetMoviesScreeningsInCities(ctx context.Context, in *GetMoviesScreeningsInCitiesRequest, opts ...grpc.CallOption) (*PreviewScreenings, error) + // Returns screenings in the cinema screenings in specified city with specified movie_id. + GetScreeningsInCity(ctx context.Context, in *GetScreeningsInCityRequest, opts ...grpc.CallOption) (*CityScreenings, error) // Returns info for the halls with specified ids (without configuration). GetHalls(ctx context.Context, in *GetHallsRequest, opts ...grpc.CallOption) (*Halls, error) // Returns all screenings for a movie in a specific cinema. @@ -76,6 +80,15 @@ func (c *cinemaServiceV1Client) GetCinema(ctx context.Context, in *GetCinemaRequ return out, nil } +func (c *cinemaServiceV1Client) GetScreening(ctx context.Context, in *GetScreeningRequest, opts ...grpc.CallOption) (*GetScreeningResponse, error) { + out := new(GetScreeningResponse) + err := c.cc.Invoke(ctx, "/cinema_service.cinemaServiceV1/GetScreening", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *cinemaServiceV1Client) GetMoviesScreenings(ctx context.Context, in *GetMoviesScreeningsRequest, opts ...grpc.CallOption) (*PreviewScreenings, error) { out := new(PreviewScreenings) err := c.cc.Invoke(ctx, "/cinema_service.cinemaServiceV1/GetMoviesScreenings", in, out, opts...) @@ -94,6 +107,15 @@ func (c *cinemaServiceV1Client) GetMoviesScreeningsInCities(ctx context.Context, return out, nil } +func (c *cinemaServiceV1Client) GetScreeningsInCity(ctx context.Context, in *GetScreeningsInCityRequest, opts ...grpc.CallOption) (*CityScreenings, error) { + out := new(CityScreenings) + err := c.cc.Invoke(ctx, "/cinema_service.cinemaServiceV1/GetScreeningsInCity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *cinemaServiceV1Client) GetHalls(ctx context.Context, in *GetHallsRequest, opts ...grpc.CallOption) (*Halls, error) { out := new(Halls) err := c.cc.Invoke(ctx, "/cinema_service.cinemaServiceV1/GetHalls", in, out, opts...) @@ -131,10 +153,14 @@ type CinemaServiceV1Server interface { GetCinemasInCity(context.Context, *GetCinemasInCityRequest) (*Cinemas, error) // Returns cinema with specified id. GetCinema(context.Context, *GetCinemaRequest) (*Cinema, error) + // Returns info about screening. + GetScreening(context.Context, *GetScreeningRequest) (*GetScreeningResponse, error) // Returns all movies that are in the cinema screenings in a particular cinema. GetMoviesScreenings(context.Context, *GetMoviesScreeningsRequest) (*PreviewScreenings, error) // Returns all movies screenings in the cinema screenings in specified cities, or in all cities, if not specified. GetMoviesScreeningsInCities(context.Context, *GetMoviesScreeningsInCitiesRequest) (*PreviewScreenings, error) + // Returns screenings in the cinema screenings in specified city with specified movie_id. + GetScreeningsInCity(context.Context, *GetScreeningsInCityRequest) (*CityScreenings, error) // Returns info for the halls with specified ids (without configuration). GetHalls(context.Context, *GetHallsRequest) (*Halls, error) // Returns all screenings for a movie in a specific cinema. @@ -157,12 +183,18 @@ func (UnimplementedCinemaServiceV1Server) GetCinemasInCity(context.Context, *Get func (UnimplementedCinemaServiceV1Server) GetCinema(context.Context, *GetCinemaRequest) (*Cinema, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCinema not implemented") } +func (UnimplementedCinemaServiceV1Server) GetScreening(context.Context, *GetScreeningRequest) (*GetScreeningResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetScreening not implemented") +} func (UnimplementedCinemaServiceV1Server) GetMoviesScreenings(context.Context, *GetMoviesScreeningsRequest) (*PreviewScreenings, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMoviesScreenings not implemented") } func (UnimplementedCinemaServiceV1Server) GetMoviesScreeningsInCities(context.Context, *GetMoviesScreeningsInCitiesRequest) (*PreviewScreenings, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMoviesScreeningsInCities not implemented") } +func (UnimplementedCinemaServiceV1Server) GetScreeningsInCity(context.Context, *GetScreeningsInCityRequest) (*CityScreenings, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetScreeningsInCity not implemented") +} func (UnimplementedCinemaServiceV1Server) GetHalls(context.Context, *GetHallsRequest) (*Halls, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHalls not implemented") } @@ -239,6 +271,24 @@ func _CinemaServiceV1_GetCinema_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _CinemaServiceV1_GetScreening_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetScreeningRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CinemaServiceV1Server).GetScreening(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cinema_service.cinemaServiceV1/GetScreening", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CinemaServiceV1Server).GetScreening(ctx, req.(*GetScreeningRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _CinemaServiceV1_GetMoviesScreenings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetMoviesScreeningsRequest) if err := dec(in); err != nil { @@ -275,6 +325,24 @@ func _CinemaServiceV1_GetMoviesScreeningsInCities_Handler(srv interface{}, ctx c return interceptor(ctx, in, info, handler) } +func _CinemaServiceV1_GetScreeningsInCity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetScreeningsInCityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CinemaServiceV1Server).GetScreeningsInCity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cinema_service.cinemaServiceV1/GetScreeningsInCity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CinemaServiceV1Server).GetScreeningsInCity(ctx, req.(*GetScreeningsInCityRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _CinemaServiceV1_GetHalls_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetHallsRequest) if err := dec(in); err != nil { @@ -348,6 +416,10 @@ var CinemaServiceV1_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetCinema", Handler: _CinemaServiceV1_GetCinema_Handler, }, + { + MethodName: "GetScreening", + Handler: _CinemaServiceV1_GetScreening_Handler, + }, { MethodName: "GetMoviesScreenings", Handler: _CinemaServiceV1_GetMoviesScreenings_Handler, @@ -356,6 +428,10 @@ var CinemaServiceV1_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetMoviesScreeningsInCities", Handler: _CinemaServiceV1_GetMoviesScreeningsInCities_Handler, }, + { + MethodName: "GetScreeningsInCity", + Handler: _CinemaServiceV1_GetScreeningsInCity_Handler, + }, { MethodName: "GetHalls", Handler: _CinemaServiceV1_GetHalls_Handler, diff --git a/pkg/cinema_service/v1/protos/cinema_service_v1_messages.pb.go b/pkg/cinema_service/v1/protos/cinema_service_v1_messages.pb.go index 1b3e637..e6bc476 100644 --- a/pkg/cinema_service/v1/protos/cinema_service_v1_messages.pb.go +++ b/pkg/cinema_service/v1/protos/cinema_service_v1_messages.pb.go @@ -1047,6 +1047,211 @@ func (x *GetCinemaRequest) GetCinemaId() int32 { return 0 } +type GetScreeningsInCityRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CityId int32 `protobuf:"varint,1,opt,name=cityId,json=city_id,proto3" json:"cityId,omitempty"` + MovieId int32 `protobuf:"varint,2,opt,name=movieId,json=movie_id,proto3" json:"movieId,omitempty"` + StartPeriod *Timestamp `protobuf:"bytes,3,opt,name=startPeriod,json=start_period,proto3" json:"startPeriod,omitempty"` + EndPeriod *Timestamp `protobuf:"bytes,4,opt,name=endPeriod,json=end_period,proto3" json:"endPeriod,omitempty"` +} + +func (x *GetScreeningsInCityRequest) Reset() { + *x = GetScreeningsInCityRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cinema_service_v1_messages_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetScreeningsInCityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetScreeningsInCityRequest) ProtoMessage() {} + +func (x *GetScreeningsInCityRequest) ProtoReflect() protoreflect.Message { + mi := &file_cinema_service_v1_messages_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetScreeningsInCityRequest.ProtoReflect.Descriptor instead. +func (*GetScreeningsInCityRequest) Descriptor() ([]byte, []int) { + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{18} +} + +func (x *GetScreeningsInCityRequest) GetCityId() int32 { + if x != nil { + return x.CityId + } + return 0 +} + +func (x *GetScreeningsInCityRequest) GetMovieId() int32 { + if x != nil { + return x.MovieId + } + return 0 +} + +func (x *GetScreeningsInCityRequest) GetStartPeriod() *Timestamp { + if x != nil { + return x.StartPeriod + } + return nil +} + +func (x *GetScreeningsInCityRequest) GetEndPeriod() *Timestamp { + if x != nil { + return x.EndPeriod + } + return nil +} + +type CityScreening struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScreeningId int64 `protobuf:"varint,1,opt,name=screeningId,json=screening_id,proto3" json:"screeningId,omitempty"` + CinemaId int32 `protobuf:"varint,2,opt,name=cinema_id,proto3" json:"cinema_id,omitempty"` + ScreeningType string `protobuf:"bytes,3,opt,name=screeningType,json=screening_type,proto3" json:"screeningType,omitempty"` + StartTime *Timestamp `protobuf:"bytes,4,opt,name=startTime,json=start_time,proto3" json:"startTime,omitempty"` + HallID int32 `protobuf:"varint,5,opt,name=hallID,json=hall_id,proto3" json:"hallID,omitempty"` + TicketPrice *Price `protobuf:"bytes,6,opt,name=ticketPrice,json=ticket_price,proto3" json:"ticketPrice,omitempty"` +} + +func (x *CityScreening) Reset() { + *x = CityScreening{} + if protoimpl.UnsafeEnabled { + mi := &file_cinema_service_v1_messages_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CityScreening) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CityScreening) ProtoMessage() {} + +func (x *CityScreening) ProtoReflect() protoreflect.Message { + mi := &file_cinema_service_v1_messages_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CityScreening.ProtoReflect.Descriptor instead. +func (*CityScreening) Descriptor() ([]byte, []int) { + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{19} +} + +func (x *CityScreening) GetScreeningId() int64 { + if x != nil { + return x.ScreeningId + } + return 0 +} + +func (x *CityScreening) GetCinemaId() int32 { + if x != nil { + return x.CinemaId + } + return 0 +} + +func (x *CityScreening) GetScreeningType() string { + if x != nil { + return x.ScreeningType + } + return "" +} + +func (x *CityScreening) GetStartTime() *Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *CityScreening) GetHallID() int32 { + if x != nil { + return x.HallID + } + return 0 +} + +func (x *CityScreening) GetTicketPrice() *Price { + if x != nil { + return x.TicketPrice + } + return nil +} + +type CityScreenings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Screenings []*CityScreening `protobuf:"bytes,1,rep,name=screenings,proto3" json:"screenings,omitempty"` +} + +func (x *CityScreenings) Reset() { + *x = CityScreenings{} + if protoimpl.UnsafeEnabled { + mi := &file_cinema_service_v1_messages_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CityScreenings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CityScreenings) ProtoMessage() {} + +func (x *CityScreenings) ProtoReflect() protoreflect.Message { + mi := &file_cinema_service_v1_messages_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CityScreenings.ProtoReflect.Descriptor instead. +func (*CityScreenings) Descriptor() ([]byte, []int) { + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{20} +} + +func (x *CityScreenings) GetScreenings() []*CityScreening { + if x != nil { + return x.Screenings + } + return nil +} + type GetHallsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1059,7 +1264,7 @@ type GetHallsRequest struct { func (x *GetHallsRequest) Reset() { *x = GetHallsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cinema_service_v1_messages_proto_msgTypes[18] + mi := &file_cinema_service_v1_messages_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1072,7 +1277,7 @@ func (x *GetHallsRequest) String() string { func (*GetHallsRequest) ProtoMessage() {} func (x *GetHallsRequest) ProtoReflect() protoreflect.Message { - mi := &file_cinema_service_v1_messages_proto_msgTypes[18] + mi := &file_cinema_service_v1_messages_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1085,7 +1290,7 @@ func (x *GetHallsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHallsRequest.ProtoReflect.Descriptor instead. func (*GetHallsRequest) Descriptor() ([]byte, []int) { - return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{18} + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{21} } func (x *GetHallsRequest) GetHallsIds() string { @@ -1106,7 +1311,7 @@ type GetHallConfigurationRequest struct { func (x *GetHallConfigurationRequest) Reset() { *x = GetHallConfigurationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cinema_service_v1_messages_proto_msgTypes[19] + mi := &file_cinema_service_v1_messages_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1119,7 +1324,7 @@ func (x *GetHallConfigurationRequest) String() string { func (*GetHallConfigurationRequest) ProtoMessage() {} func (x *GetHallConfigurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_cinema_service_v1_messages_proto_msgTypes[19] + mi := &file_cinema_service_v1_messages_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1132,7 +1337,7 @@ func (x *GetHallConfigurationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHallConfigurationRequest.ProtoReflect.Descriptor instead. func (*GetHallConfigurationRequest) Descriptor() ([]byte, []int) { - return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{19} + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{22} } func (x *GetHallConfigurationRequest) GetHallId() int32 { @@ -1156,7 +1361,7 @@ type Place struct { func (x *Place) Reset() { *x = Place{} if protoimpl.UnsafeEnabled { - mi := &file_cinema_service_v1_messages_proto_msgTypes[20] + mi := &file_cinema_service_v1_messages_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1169,7 +1374,7 @@ func (x *Place) String() string { func (*Place) ProtoMessage() {} func (x *Place) ProtoReflect() protoreflect.Message { - mi := &file_cinema_service_v1_messages_proto_msgTypes[20] + mi := &file_cinema_service_v1_messages_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1182,7 +1387,7 @@ func (x *Place) ProtoReflect() protoreflect.Message { // Deprecated: Use Place.ProtoReflect.Descriptor instead. func (*Place) Descriptor() ([]byte, []int) { - return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{20} + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{23} } func (x *Place) GetRow() int32 { @@ -1213,6 +1418,148 @@ func (x *Place) GetGridPosY() float32 { return 0 } +type GetScreeningRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScreeningId int32 `protobuf:"varint,1,opt,name=screeningId,json=screening_id,proto3" json:"screeningId,omitempty"` +} + +func (x *GetScreeningRequest) Reset() { + *x = GetScreeningRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cinema_service_v1_messages_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetScreeningRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetScreeningRequest) ProtoMessage() {} + +func (x *GetScreeningRequest) ProtoReflect() protoreflect.Message { + mi := &file_cinema_service_v1_messages_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetScreeningRequest.ProtoReflect.Descriptor instead. +func (*GetScreeningRequest) Descriptor() ([]byte, []int) { + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{24} +} + +func (x *GetScreeningRequest) GetScreeningId() int32 { + if x != nil { + return x.ScreeningId + } + return 0 +} + +type GetScreeningResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CinemaId int32 `protobuf:"varint,1,opt,name=cinemaId,json=cinema_id,proto3" json:"cinemaId,omitempty"` + MovieId int32 `protobuf:"varint,2,opt,name=movieId,json=movie_id,proto3" json:"movieId,omitempty"` + ScreeningType string `protobuf:"bytes,3,opt,name=screeningType,json=screening_type,proto3" json:"screeningType,omitempty"` + StartTime *Timestamp `protobuf:"bytes,4,opt,name=startTime,json=start_time,proto3" json:"startTime,omitempty"` + HallID int32 `protobuf:"varint,5,opt,name=hallID,json=hall_id,proto3" json:"hallID,omitempty"` + TicketPrice *Price `protobuf:"bytes,6,opt,name=ticketPrice,json=ticket_price,proto3" json:"ticketPrice,omitempty"` + HallConfiguration *HallConfiguration `protobuf:"bytes,7,opt,name=hallConfiguration,json=hall_configuration,proto3" json:"hallConfiguration,omitempty"` +} + +func (x *GetScreeningResponse) Reset() { + *x = GetScreeningResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cinema_service_v1_messages_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetScreeningResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetScreeningResponse) ProtoMessage() {} + +func (x *GetScreeningResponse) ProtoReflect() protoreflect.Message { + mi := &file_cinema_service_v1_messages_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetScreeningResponse.ProtoReflect.Descriptor instead. +func (*GetScreeningResponse) Descriptor() ([]byte, []int) { + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{25} +} + +func (x *GetScreeningResponse) GetCinemaId() int32 { + if x != nil { + return x.CinemaId + } + return 0 +} + +func (x *GetScreeningResponse) GetMovieId() int32 { + if x != nil { + return x.MovieId + } + return 0 +} + +func (x *GetScreeningResponse) GetScreeningType() string { + if x != nil { + return x.ScreeningType + } + return "" +} + +func (x *GetScreeningResponse) GetStartTime() *Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *GetScreeningResponse) GetHallID() int32 { + if x != nil { + return x.HallID + } + return 0 +} + +func (x *GetScreeningResponse) GetTicketPrice() *Price { + if x != nil { + return x.TicketPrice + } + return nil +} + +func (x *GetScreeningResponse) GetHallConfiguration() *HallConfiguration { + if x != nil { + return x.HallConfiguration + } + return nil +} + type HallConfiguration struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1224,7 +1571,7 @@ type HallConfiguration struct { func (x *HallConfiguration) Reset() { *x = HallConfiguration{} if protoimpl.UnsafeEnabled { - mi := &file_cinema_service_v1_messages_proto_msgTypes[21] + mi := &file_cinema_service_v1_messages_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1237,7 +1584,7 @@ func (x *HallConfiguration) String() string { func (*HallConfiguration) ProtoMessage() {} func (x *HallConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_cinema_service_v1_messages_proto_msgTypes[21] + mi := &file_cinema_service_v1_messages_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1250,7 +1597,7 @@ func (x *HallConfiguration) ProtoReflect() protoreflect.Message { // Deprecated: Use HallConfiguration.ProtoReflect.Descriptor instead. func (*HallConfiguration) Descriptor() ([]byte, []int) { - return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{21} + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{26} } func (x *HallConfiguration) GetPlace() []*Place { @@ -1271,7 +1618,7 @@ type GetCinemaHalls struct { func (x *GetCinemaHalls) Reset() { *x = GetCinemaHalls{} if protoimpl.UnsafeEnabled { - mi := &file_cinema_service_v1_messages_proto_msgTypes[22] + mi := &file_cinema_service_v1_messages_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1284,7 +1631,7 @@ func (x *GetCinemaHalls) String() string { func (*GetCinemaHalls) ProtoMessage() {} func (x *GetCinemaHalls) ProtoReflect() protoreflect.Message { - mi := &file_cinema_service_v1_messages_proto_msgTypes[22] + mi := &file_cinema_service_v1_messages_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1297,7 +1644,7 @@ func (x *GetCinemaHalls) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCinemaHalls.ProtoReflect.Descriptor instead. func (*GetCinemaHalls) Descriptor() ([]byte, []int) { - return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{22} + return file_cinema_service_v1_messages_proto_rawDescGZIP(), []int{27} } func (x *GetCinemaHalls) GetCinemaId() int32 { @@ -1430,29 +1777,88 @@ var file_cinema_service_v1_messages_proto_rawDesc = []byte{ 0x2e, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x49, 0x64, 0x22, - 0x2e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x08, 0x68, 0x61, 0x6c, 0x6c, 0x73, 0x49, 0x64, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x69, 0x64, 0x73, 0x22, - 0x36, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, - 0x0a, 0x06, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x22, 0x69, 0x0a, 0x05, 0x50, 0x6c, 0x61, 0x63, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x72, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, - 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x73, 0x65, 0x61, 0x74, 0x12, 0x1c, 0x0a, 0x0a, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x70, - 0x6f, 0x73, 0x5f, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x67, 0x72, 0x69, 0x64, - 0x50, 0x6f, 0x73, 0x58, 0x12, 0x1c, 0x0a, 0x0a, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x70, 0x6f, 0x73, - 0x5f, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x67, 0x72, 0x69, 0x64, 0x50, 0x6f, - 0x73, 0x59, 0x22, 0x40, 0x0a, 0x11, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x52, 0x05, 0x70, - 0x6c, 0x61, 0x63, 0x65, 0x22, 0x2d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x69, 0x6e, 0x65, 0x6d, - 0x61, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x1b, 0x0a, 0x08, 0x43, 0x69, 0x6e, 0x65, 0x6d, 0x61, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, - 0x5f, 0x69, 0x64, 0x42, 0x1a, 0x5a, 0x18, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0xc8, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, + 0x73, 0x49, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x06, 0x63, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x63, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x07, 0x6d, 0x6f, 0x76, 0x69, 0x65, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x5f, + 0x69, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x12, 0x38, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, + 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x84, 0x02, 0x0a, 0x0d, 0x43, + 0x69, 0x74, 0x79, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x0a, 0x0b, + 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x69, 0x64, 0x12, 0x25, 0x0a, + 0x0d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x17, + 0x0a, 0x06, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x0b, 0x74, 0x69, 0x63, 0x6b, 0x65, + 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, + 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x52, 0x0c, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x22, 0x4f, 0x0a, 0x0e, 0x43, 0x69, 0x74, 0x79, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x69, 0x74, 0x79, 0x53, 0x63, 0x72, + 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, + 0x67, 0x73, 0x22, 0x2e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x08, 0x68, 0x61, 0x6c, 0x6c, 0x73, 0x49, 0x64, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x69, + 0x64, 0x73, 0x22, 0x36, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x06, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x22, 0x69, 0x0a, 0x05, 0x50, 0x6c, + 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x72, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x65, 0x61, 0x74, 0x12, 0x1c, 0x0a, 0x0a, 0x67, 0x72, 0x69, + 0x64, 0x5f, 0x70, 0x6f, 0x73, 0x5f, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x67, + 0x72, 0x69, 0x64, 0x50, 0x6f, 0x73, 0x58, 0x12, 0x1c, 0x0a, 0x0a, 0x67, 0x72, 0x69, 0x64, 0x5f, + 0x70, 0x6f, 0x73, 0x5f, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x67, 0x72, 0x69, + 0x64, 0x50, 0x6f, 0x73, 0x59, 0x22, 0x38, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, + 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0b, + 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x22, + 0xd4, 0x02, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x08, 0x63, 0x69, 0x6e, 0x65, + 0x6d, 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x69, 0x6e, 0x65, + 0x6d, 0x61, 0x5f, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x07, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x5f, 0x69, 0x64, + 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x69, + 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x69, 0x6e, + 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x12, 0x17, 0x0a, 0x06, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x0b, 0x74, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x0c, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x68, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x63, 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x12, 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x40, 0x0a, 0x11, 0x48, 0x61, 0x6c, 0x6c, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x05, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x69, 0x6e, + 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x63, + 0x65, 0x52, 0x05, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x22, 0x2d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, + 0x69, 0x6e, 0x65, 0x6d, 0x61, 0x48, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x1b, 0x0a, 0x08, 0x43, 0x69, + 0x6e, 0x65, 0x6d, 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x69, + 0x6e, 0x65, 0x6d, 0x61, 0x5f, 0x69, 0x64, 0x42, 0x1a, 0x5a, 0x18, 0x63, 0x69, 0x6e, 0x65, 0x6d, + 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1467,7 +1873,7 @@ func file_cinema_service_v1_messages_proto_rawDescGZIP() []byte { return file_cinema_service_v1_messages_proto_rawDescData } -var file_cinema_service_v1_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_cinema_service_v1_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_cinema_service_v1_messages_proto_goTypes = []interface{}{ (*Timestamp)(nil), // 0: cinema_service.Timestamp (*GetMoviesScreeningsRequest)(nil), // 1: cinema_service.GetMoviesScreeningsRequest @@ -1487,11 +1893,16 @@ var file_cinema_service_v1_messages_proto_goTypes = []interface{}{ (*Hall)(nil), // 15: cinema_service.Hall (*Halls)(nil), // 16: cinema_service.Halls (*GetCinemaRequest)(nil), // 17: cinema_service.GetCinemaRequest - (*GetHallsRequest)(nil), // 18: cinema_service.GetHallsRequest - (*GetHallConfigurationRequest)(nil), // 19: cinema_service.GetHallConfigurationRequest - (*Place)(nil), // 20: cinema_service.Place - (*HallConfiguration)(nil), // 21: cinema_service.HallConfiguration - (*GetCinemaHalls)(nil), // 22: cinema_service.GetCinemaHalls + (*GetScreeningsInCityRequest)(nil), // 18: cinema_service.GetScreeningsInCityRequest + (*CityScreening)(nil), // 19: cinema_service.CityScreening + (*CityScreenings)(nil), // 20: cinema_service.CityScreenings + (*GetHallsRequest)(nil), // 21: cinema_service.GetHallsRequest + (*GetHallConfigurationRequest)(nil), // 22: cinema_service.GetHallConfigurationRequest + (*Place)(nil), // 23: cinema_service.Place + (*GetScreeningRequest)(nil), // 24: cinema_service.GetScreeningRequest + (*GetScreeningResponse)(nil), // 25: cinema_service.GetScreeningResponse + (*HallConfiguration)(nil), // 26: cinema_service.HallConfiguration + (*GetCinemaHalls)(nil), // 27: cinema_service.GetCinemaHalls } var file_cinema_service_v1_messages_proto_depIdxs = []int32{ 0, // 0: cinema_service.GetMoviesScreeningsRequest.startPeriod:type_name -> cinema_service.Timestamp @@ -1508,12 +1919,20 @@ var file_cinema_service_v1_messages_proto_depIdxs = []int32{ 11, // 11: cinema_service.Cinemas.cinemas:type_name -> cinema_service.Cinema 13, // 12: cinema_service.Cities.cities:type_name -> cinema_service.City 15, // 13: cinema_service.Halls.halls:type_name -> cinema_service.Hall - 20, // 14: cinema_service.HallConfiguration.place:type_name -> cinema_service.Place - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 0, // 14: cinema_service.GetScreeningsInCityRequest.startPeriod:type_name -> cinema_service.Timestamp + 0, // 15: cinema_service.GetScreeningsInCityRequest.endPeriod:type_name -> cinema_service.Timestamp + 0, // 16: cinema_service.CityScreening.startTime:type_name -> cinema_service.Timestamp + 3, // 17: cinema_service.CityScreening.ticketPrice:type_name -> cinema_service.Price + 19, // 18: cinema_service.CityScreenings.screenings:type_name -> cinema_service.CityScreening + 0, // 19: cinema_service.GetScreeningResponse.startTime:type_name -> cinema_service.Timestamp + 3, // 20: cinema_service.GetScreeningResponse.ticketPrice:type_name -> cinema_service.Price + 26, // 21: cinema_service.GetScreeningResponse.hallConfiguration:type_name -> cinema_service.HallConfiguration + 23, // 22: cinema_service.HallConfiguration.place:type_name -> cinema_service.Place + 23, // [23:23] is the sub-list for method output_type + 23, // [23:23] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name } func init() { file_cinema_service_v1_messages_proto_init() } @@ -1739,7 +2158,7 @@ func file_cinema_service_v1_messages_proto_init() { } } file_cinema_service_v1_messages_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHallsRequest); i { + switch v := v.(*GetScreeningsInCityRequest); i { case 0: return &v.state case 1: @@ -1751,7 +2170,7 @@ func file_cinema_service_v1_messages_proto_init() { } } file_cinema_service_v1_messages_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHallConfigurationRequest); i { + switch v := v.(*CityScreening); i { case 0: return &v.state case 1: @@ -1763,7 +2182,7 @@ func file_cinema_service_v1_messages_proto_init() { } } file_cinema_service_v1_messages_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Place); i { + switch v := v.(*CityScreenings); i { case 0: return &v.state case 1: @@ -1775,7 +2194,7 @@ func file_cinema_service_v1_messages_proto_init() { } } file_cinema_service_v1_messages_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HallConfiguration); i { + switch v := v.(*GetHallsRequest); i { case 0: return &v.state case 1: @@ -1787,6 +2206,66 @@ func file_cinema_service_v1_messages_proto_init() { } } file_cinema_service_v1_messages_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHallConfigurationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cinema_service_v1_messages_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Place); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cinema_service_v1_messages_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetScreeningRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cinema_service_v1_messages_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetScreeningResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cinema_service_v1_messages_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HallConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cinema_service_v1_messages_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCinemaHalls); i { case 0: return &v.state @@ -1806,7 +2285,7 @@ func file_cinema_service_v1_messages_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cinema_service_v1_messages_proto_rawDesc, NumEnums: 0, - NumMessages: 23, + NumMessages: 28, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/cinema_service/v1/cinema_service_v1.proto b/proto/cinema_service/v1/cinema_service_v1.proto index e3f43f7..8856ad7 100644 --- a/proto/cinema_service/v1/cinema_service_v1.proto +++ b/proto/cinema_service/v1/cinema_service_v1.proto @@ -76,6 +76,13 @@ service cinemaServiceV1 { }; } + // Returns info about screening. + rpc GetScreening(GetScreeningRequest) returns(GetScreeningResponse) { + option (google.api.http) = { + get: "/v1/screenings/{screeningId}" + }; + } + // Returns all movies that are in the cinema screenings in a particular cinema. rpc GetMoviesScreenings(GetMoviesScreeningsRequest) returns(PreviewScreenings){ option (google.api.http) = { @@ -106,6 +113,21 @@ service cinemaServiceV1 { }; } + // Returns screenings in the cinema screenings in specified city with specified movie_id. + rpc GetScreeningsInCity(GetScreeningsInCityRequest) returns(CityScreenings){ + option (google.api.http) = { + get: "/v1/city/{cityId}/screenings" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses: { + key: "400" + value: { + description: "Returned when specified start_period or end_period is not valid." + } + }; + }; + } + // Returns info for the halls with specified ids (without configuration). rpc GetHalls(GetHallsRequest) returns(Halls){ option (google.api.http) = { diff --git a/proto/cinema_service/v1/cinema_service_v1_messages.proto b/proto/cinema_service/v1/cinema_service_v1_messages.proto index db64586..bd17f81 100644 --- a/proto/cinema_service/v1/cinema_service_v1_messages.proto +++ b/proto/cinema_service/v1/cinema_service_v1_messages.proto @@ -90,6 +90,26 @@ message GetCinemaRequest { int32 cinemaId = 1; } +message GetScreeningsInCityRequest { + int32 cityId =1[json_name="city_id"]; + int32 movieId = 2[json_name="movie_id"]; + Timestamp startPeriod = 3 [ json_name = "start_period" ]; + Timestamp endPeriod = 4 [ json_name = "end_period" ]; +} + +message CityScreening { + int64 screeningId = 1 [ json_name = "screening_id" ]; + int32 cinema_id = 2 [ json_name = "cinema_id" ]; + string screeningType = 3 [ json_name = "screening_type" ]; + Timestamp startTime = 4 [ json_name = "start_time" ]; + int32 hallID = 5 [ json_name = "hall_id" ]; + Price ticketPrice = 6 [ json_name = "ticket_price" ]; +} + +message CityScreenings { + repeated CityScreening screenings = 1; +} + message GetHallsRequest { // for multiple values use ',' separator string hallsIds = 1 [ json_name = "halls_ids" ]; @@ -105,6 +125,20 @@ message Place { float grid_pos_y = 4; } +message GetScreeningRequest { + int32 screeningId = 1[json_name="screening_id"]; +} + +message GetScreeningResponse { + int32 cinemaId = 1[json_name="cinema_id"]; + int32 movieId = 2 [ json_name = "movie_id" ]; + string screeningType = 3 [ json_name = "screening_type" ]; + Timestamp startTime = 4 [ json_name = "start_time" ]; + int32 hallID = 5 [ json_name = "hall_id" ]; + Price ticketPrice = 6 [ json_name = "ticket_price" ]; + HallConfiguration hallConfiguration = 7[json_name="hall_configuration"]; +} + message HallConfiguration { repeated Place place = 1; } message GetCinemaHalls { diff --git a/swagger/docs/cinema_service_v1.swagger.json b/swagger/docs/cinema_service_v1.swagger.json index f14b84a..4c8a3e9 100644 --- a/swagger/docs/cinema_service_v1.swagger.json +++ b/swagger/docs/cinema_service_v1.swagger.json @@ -278,6 +278,75 @@ ] } }, + "/v1/city/{city_id}/screenings": { + "get": { + "summary": "Returns screenings in the cinema screenings in specified city with specified movie_id.", + "operationId": "cinemaServiceV1_GetScreeningsInCity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/cinema_serviceCityScreenings" + } + }, + "400": { + "description": "Returned when specified start_period or end_period is not valid.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Something went wrong.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "city_id", + "in": "path", + "required": true, + "type": "integer", + "format": "int32" + }, + { + "name": "movie_id", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "start_period.formatted_timestamp", + "description": "Time in format RFC3339, time must be in UTC\nexample: 2023-11-10T23:00:00Z", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "end_period.formatted_timestamp", + "description": "Time in format RFC3339, time must be in UTC\nexample: 2023-11-10T23:00:00Z", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "cinemaServiceV1" + ] + } + }, "/v1/hall/{hall_id}/configuration": { "get": { "summary": "Returns the configuration of the hall.", @@ -427,6 +496,50 @@ "cinemaServiceV1" ] } + }, + "/v1/screenings/{screening_id}": { + "get": { + "summary": "Returns info about screening.", + "operationId": "cinemaServiceV1_GetScreening", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/cinema_serviceGetScreeningResponse" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Something went wrong.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "screening_id", + "in": "path", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "cinemaServiceV1" + ] + } } }, "definitions": { @@ -484,6 +597,44 @@ } } }, + "cinema_serviceCityScreening": { + "type": "object", + "properties": { + "screening_id": { + "type": "string", + "format": "int64" + }, + "cinema_id": { + "type": "integer", + "format": "int32" + }, + "screening_type": { + "type": "string" + }, + "start_time": { + "$ref": "#/definitions/cinema_serviceTimestamp" + }, + "hall_id": { + "type": "integer", + "format": "int32" + }, + "ticket_price": { + "$ref": "#/definitions/cinema_servicePrice" + } + } + }, + "cinema_serviceCityScreenings": { + "type": "object", + "properties": { + "screenings": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/cinema_serviceCityScreening" + } + } + } + }, "cinema_serviceCoordinates": { "type": "object", "properties": { @@ -497,6 +648,35 @@ } } }, + "cinema_serviceGetScreeningResponse": { + "type": "object", + "properties": { + "cinema_id": { + "type": "integer", + "format": "int32" + }, + "movie_id": { + "type": "integer", + "format": "int32" + }, + "screening_type": { + "type": "string" + }, + "start_time": { + "$ref": "#/definitions/cinema_serviceTimestamp" + }, + "hall_id": { + "type": "integer", + "format": "int32" + }, + "ticket_price": { + "$ref": "#/definitions/cinema_servicePrice" + }, + "hall_configuration": { + "$ref": "#/definitions/cinema_serviceHallConfiguration" + } + } + }, "cinema_serviceHall": { "type": "object", "properties": {