Skip to content

Commit

Permalink
add field VerURL
Browse files Browse the repository at this point in the history
  • Loading branch information
Ugarov Ruslan Denisovich authored and UnicoYal committed Dec 16, 2024
1 parent 9bf5c3c commit b894883
Show file tree
Hide file tree
Showing 14 changed files with 344 additions and 255 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- release/use-subscription-in-movies
- release/linter-comments
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -61,9 +61,9 @@ jobs:

build-and-push:
runs-on: ubuntu-latest
needs:
- linter
- test
# needs:
# - linter
# - test

steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ generate-movie-api:
mkdir -p movie_service/pkg/movie_v1
protoc --proto_path movie_service/proto \
--go_out=movie_service/pkg/movie_v1 --go_opt=paths=source_relative \
--plugin=protoc-gen-go=/Users/unicoyal/go/bin/protoc-gen-go \
--plugin=protoc-gen-go=/Users/rugarov/go/bin/protoc-gen-go \
--go-grpc_out=movie_service/pkg/movie_v1 --go-grpc_opt=paths=source_relative \
--plugin=protoc-gen-go-grpc=/Users/unicoyal/go/bin/protoc-gen-go-grpc \
--plugin=protoc-gen-go-grpc=/Users/rugarov/go/bin/protoc-gen-go-grpc \
movie_service/proto/movie.proto

generate-payment-api:
Expand Down
32 changes: 16 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,6 @@ services:
- /sys:/host/sys:ro
- /:/rootfs:ro

watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
environment:
- TZ=Europe/London
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_ROLLING_RESTART=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
command: --interval 30 facade_app user_app payment_app movie_app auth_app
networks:
- cassette-world
depends_on:
- facade_app

facade_redis:
image: 'redis:latest'
command: redis-server
Expand All @@ -77,6 +61,22 @@ watchtower:
networks:
- cassette-world

watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
environment:
- TZ=Europe/London
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_ROLLING_RESTART=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
command: --interval 30 facade_app user_app payment_app movie_app auth_app
networks:
- cassette-world
depends_on:
- facade_app

networks:
cassette-world:
external:
Expand Down
1 change: 1 addition & 0 deletions internal/app/client/movie.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func (m MovieClient) SearchMovies(ctx context.Context, query string) ([]models.M
AlbumURL: mov.AlbumUrl,
Rating: mov.Rating,
Title: mov.Title,
VerURL: mov.VerUrl,
}
}
return respp, nil
Expand Down
1 change: 1 addition & 0 deletions internal/app/models/easy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type MovieInfo struct {
FullDescription string `json:"full_description"`
CardURL string `json:"card_url"`
AlbumURL string `json:"album_url"`
VerURL string `json:"ver_url"`
TitleURL string `json:"title_url"`
Rating float32 `json:"rating"`
ReleaseDate string `json:"release_date"`
Expand Down
7 changes: 7 additions & 0 deletions internal/app/models/easy_easyjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/app/movie/delivery/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (m *MovieHandler) SearchMovies(w http.ResponseWriter, r *http.Request) {
"title": movie.Title,
"card_url": movie.CardURL,
"album_url": movie.AlbumURL,
"ver_url": movie.VerURL,
"rating": strconv.FormatFloat(float64(movie.Rating), 'f', -1, 32),
"release_date": movie.ReleaseDate,
"movie_type": movie.MovieType,
Expand Down
29 changes: 29 additions & 0 deletions internal/db/script_elastic/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type Movie struct {
Title string `json:"title"`
CardURL string `json:"card_url"`
AlbumURL string `json:"album_url"`
VerURL string `json:"ver_url"`
Rating float64 `json:"rating"`
ReleaseDate string `json:"release_date"`
MovieType string `json:"movie_type"`
Expand Down Expand Up @@ -181,6 +182,7 @@ func main() {
"title": { "type": "text" },
"card_url": { "type": "text" },
"album_url": { "type": "text" },
"ver_url": { "type": "text" },
"rating": { "type": "float" },
"release_date": {
"type": "date",
Expand All @@ -203,6 +205,7 @@ func main() {
Title: "Игра в кальмара",
CardURL: "/static/movies_all/squid-game/card.webp",
AlbumURL: "/static/movies_all/squid-game/poster.webp",
VerURL: "/static/movies_all/squid-game/album.webp",
Rating: 7.6,
MovieType: "film",
Country: "Франция",
Expand All @@ -212,6 +215,7 @@ func main() {
Title: "Бумажный дом",
CardURL: "/static/movies_all/paper_house/card.webp",
AlbumURL: "/static/movies_all/paper_house/poster.webp",
VerURL: "/static/movies_all/paper_house/album.webp",
Rating: 8.2,
MovieType: "film",
Country: "Франция",
Expand All @@ -221,6 +225,7 @@ func main() {
Title: "Кухня",
CardURL: "/static/movies_all/kitcnen/card.webp",
AlbumURL: "/static/movies_all/kitcnen/poster.webp",
VerURL: "/static/movies_all/kitcnen/album.webp",
Rating: 8.2,
MovieType: "film",
Country: "Франция",
Expand All @@ -230,6 +235,7 @@ func main() {
Title: "1+1",
CardURL: "/static/movies_all/1_plus_1/card.webp",
AlbumURL: "/static/movies_all/1_plus_1/poster.webp",
VerURL: "/static/movies_all/1_plus_1/album.webp",
Rating: 8.8,
MovieType: "film",
Country: "Франция",
Expand All @@ -239,6 +245,7 @@ func main() {
Title: "Аватар",
CardURL: "/static/movies_all/avatar/card.webp",
AlbumURL: "/static/movies_all/avatar/poster.webp",
VerURL: "/static/movies_all/avatar/album.webp",
Rating: 8.0,
MovieType: "film",
Country: "США",
Expand All @@ -248,6 +255,7 @@ func main() {
Title: "Иллюзия обмана",
CardURL: "/static/movies_all/how-you-see-me/card.webp",
AlbumURL: "/static/movies_all/how-you-see-me/poster.webp",
VerURL: "/static/movies_all/how-you-see-me/album.webp",
Rating: 7.7,
MovieType: "film",
Country: "США",
Expand All @@ -257,6 +265,7 @@ func main() {
Title: "Бесславные ублюдки",
CardURL: "/static/movies_all/inglourious-basterds/card.webp",
AlbumURL: "/static/movies_all/inglourious-basterds/poster.webp",
VerURL: "/static/movies_all/inglourious-basterds/album.webp",
Rating: 8.0,
MovieType: "film",
Country: "США",
Expand All @@ -266,6 +275,7 @@ func main() {
Title: "Интерстеллар",
CardURL: "/static/movies_all/interstellar/card.webp",
AlbumURL: "/static/movies_all/interstellar/poster.webp",
VerURL: "/static/movies_all/interstellar/album.webp",
Rating: 8.6,
MovieType: "film",
Country: "США",
Expand All @@ -275,6 +285,7 @@ func main() {
Title: "Легенда №17",
CardURL: "/static/movies_all/legend17/card.webp",
AlbumURL: "/static/movies_all/legend17/poster.webp",
VerURL: "/static/movies_all/legend17/album.webp",
Rating: 8.0,
MovieType: "film",
Country: "США",
Expand All @@ -284,6 +295,7 @@ func main() {
Title: "Человек, который изменил все",
CardURL: "/static/movies_all/moneyball/card.webp",
AlbumURL: "/static/movies_all/moneyball/poster.webp",
VerURL: "/static/movies_all/moneyball/album.webp",
Rating: 7.7,
MovieType: "film",
Country: "США",
Expand All @@ -293,6 +305,7 @@ func main() {
Title: "Остров проклятых",
CardURL: "/static/movies_all/shutter-island/card.webp",
AlbumURL: "/static/movies_all/shutter-island/poster.webp",
VerURL: "/static/movies_all/shutter-island/album.webp",
Rating: 8.5,
MovieType: "film",
Country: "США",
Expand All @@ -302,6 +315,7 @@ func main() {
Title: "Такси 2",
CardURL: "/static/movies_all/taxi2/card.webp",
AlbumURL: "/static/movies_all/taxi2/poster.webp",
VerURL: "/static/movies_all/taxi2/album.webp",
Rating: 7.7,
MovieType: "film",
Country: "США",
Expand All @@ -311,6 +325,7 @@ func main() {
Title: "Множественные святые Ньюагка",
CardURL: "/static/movies_all/the-many-saints-of-newark/card.webp",
AlbumURL: "/static/movies_all/the-many-saints-of-newark/poster.webp",
VerURL: "/static/movies_all/the-many-saints-of-newark/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -320,6 +335,7 @@ func main() {
Title: "Перевозчик",
CardURL: "/static/movies_all/the-transporter/card.webp",
AlbumURL: "/static/movies_all/the-transporter/poster.webp",
VerURL: "/static/movies_all/the-transporter/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -329,6 +345,7 @@ func main() {
Title: "Трансформеры",
CardURL: "/static/movies_all/transformers/card.webp",
AlbumURL: "/static/movies_all/transformers/poster.webp",
VerURL: "/static/movies_all/transformers/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -338,6 +355,7 @@ func main() {
Title: "Волк с Уолл-Стрит",
CardURL: "/static/movies_all/wolf-of-wall-street/card.webp",
AlbumURL: "/static/movies_all/wolf-of-wall-street/poster.webp",
VerURL: "/static/movies_all/wolf-of-wall-street/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -347,6 +365,7 @@ func main() {
Title: "Мстители",
CardURL: "/static/movies_all/avengers/card.webp",
AlbumURL: "/static/movies_all/avengers/poster.webp",
VerURL: "/static/movies_all/avengers/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -356,6 +375,7 @@ func main() {
Title: "Еще по одной",
CardURL: "/static/movies_all/drunk/card.webp",
AlbumURL: "/static/movies_all/drunk/poster.webp",
VerURL: "/static/movies_all/drunk/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -365,6 +385,7 @@ func main() {
Title: "Форд против Феррари",
CardURL: "/static/movies_all/ford-v-ferrari/card.webp",
AlbumURL: "/static/movies_all/ford-v-ferrari/poster.webp",
VerURL: "/static/movies_all/ford-v-ferrari/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -374,6 +395,7 @@ func main() {
Title: "Зеленая книга",
CardURL: "/static/movies_all/greenbook/card.webp",
AlbumURL: "/static/movies_all/greenbook/poster.webp",
VerURL: "/static/movies_all/greenbook/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -383,6 +405,7 @@ func main() {
Title: "Однажды в Голливуде",
CardURL: "/static/movies_all/once-in-hollywood/card.webp",
AlbumURL: "/static/movies_all/once-in-hollywood/poster.webp",
VerURL: "/static/movies_all/once-in-hollywood/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -392,6 +415,7 @@ func main() {
Title: "Ламборгини",
CardURL: "/static/movies_all/lamborgini/card.webp",
AlbumURL: "/static/movies_all/lamborgini/poster.webp",
VerURL: "/static/movies_all/lamborgini/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -401,6 +425,7 @@ func main() {
Title: "Легенда",
CardURL: "/static/movies_all/legend/card.webp",
AlbumURL: "/static/movies_all/legend/poster.webp",
VerURL: "/static/movies_all/legend/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -410,6 +435,7 @@ func main() {
Title: "Пеле: Рождение легенды",
CardURL: "/static/movies_all/pele/card.webp",
AlbumURL: "/static/movies_all/pele/poster.webp",
VerURL: "/static/movies_all/pele/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -419,6 +445,7 @@ func main() {
Title: "Стрельцов",
CardURL: "/static/movies_all/streltsov/card.webp",
AlbumURL: "/static/movies_all/streltsov/poster.webp",
VerURL: "/static/movies_all/streltsov/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -428,6 +455,7 @@ func main() {
Title: "Гнев человеческий",
CardURL: "/static/movies_all/wrath-of-man/card.webp",
AlbumURL: "/static/movies_all/wrath-of-man/poster.webp",
VerURL: "/static/movies_all/wrath-of-man/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand All @@ -437,6 +465,7 @@ func main() {
Title: "Брат 2",
CardURL: "/static/movies_all/brother2/card.webp",
AlbumURL: "/static/movies_all/brother2/poster.webp",
VerURL: "/static/movies_all/brother2/album.webp",
Rating: 5.9,
MovieType: "film",
Country: "США",
Expand Down
1 change: 1 addition & 0 deletions movie_service/internal/movie/delivery/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ func (h *MovieHandler) SearchMovies(ctx context.Context, req *movie.SearchMovies
ReleaseDate: mov.ReleaseDate,
IsFavorite: mov.IsFavorite,
VideoUrl: mov.VideoURL,
VerUrl: mov.VerURL,

FullDescription: mov.FullDescription,
ShortDescription: mov.ShortDescription,
Expand Down
1 change: 1 addition & 0 deletions movie_service/internal/movie/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type MovieInfo struct {
FullDescription string `json:"full_description"`
CardURL string `json:"card_url"`
AlbumURL string `json:"album_url"`
VerURL string `json:"ver_url"`
TitleURL string `json:"title_url"`
Rating float32 `json:"rating"`
ReleaseDate string `json:"release_date"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (r *MovieRepo) SearchMovies(ctx context.Context, query string) ([]models.Mo
Rating float32 `json:"rating"`
AlbumURL string `json:"album_url"`
CardURL string `json:"card_url"`
VerURL string `json:"ver_url"`
} `json:"_source"`
} `json:"hits"`
} `json:"hits"`
Expand Down Expand Up @@ -95,6 +96,7 @@ func (r *MovieRepo) SearchMovies(ctx context.Context, query string) ([]models.Mo
Rating: hit.Source.Rating,
CardURL: hit.Source.CardURL,
AlbumURL: hit.Source.AlbumURL,
VerURL: hit.Source.VerURL,
}
}

Expand Down
Loading

0 comments on commit b894883

Please sign in to comment.