Files
neomovies-api/internal/api/models.go
Foxix 612e49817c Update 16 files
- /docs/swagger.yaml
- /docs/swagger.json
- /docs/docs.go
- /internal/api/init.go
- /internal/api/models.go
- /internal/api/handlers.go
- /internal/api/utils.go
- /internal/tmdb/models.go
- /internal/tmdb/client.go
- /build.sh
- /go.mod
- /go.sum
- /main.go
- /render.yaml
- /run.sh
- /README.md
2025-01-03 18:42:44 +00:00

65 lines
2.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package api
// Genre представляет жанр фильма
type Genre struct {
ID int `json:"id"`
Name string `json:"name"`
}
// Movie представляет базовую информацию о фильме
type Movie struct {
ID int `json:"id"`
Title string `json:"title"`
Overview string `json:"overview"`
PosterPath *string `json:"poster_path"`
BackdropPath *string `json:"backdrop_path"`
ReleaseDate string `json:"release_date"`
VoteAverage float64 `json:"vote_average"`
Genres []Genre `json:"genres"`
}
// MovieDetails представляет детальную информацию о фильме
type MovieDetails struct {
Movie
Runtime int `json:"runtime"`
Tagline string `json:"tagline"`
Budget int `json:"budget"`
Revenue int `json:"revenue"`
Status string `json:"status"`
}
// MoviesResponse представляет ответ со списком фильмов
type MoviesResponse struct {
Page int `json:"page"`
TotalPages int `json:"total_pages"`
TotalResults int `json:"total_results"`
Results []Movie `json:"results"`
}
// TMDBMoviesResponse представляет ответ со списком фильмов от TMDB API
type TMDBMoviesResponse struct {
Page int `json:"page"`
TotalPages int `json:"total_pages"`
TotalResults int `json:"total_results"`
Results []Movie `json:"results"`
}
// SearchResponse представляет ответ на поисковый запрос
type SearchResponse struct {
Page int `json:"page"`
TotalPages int `json:"total_pages"`
TotalResults int `json:"total_results"`
Results []MovieResponse `json:"results"`
}
// MovieResponse представляет информацию о фильме в ответе API
type MovieResponse struct {
ID int `json:"id"`
Title string `json:"title"`
Overview string `json:"overview"`
ReleaseDate string `json:"release_date"`
VoteAverage float64 `json:"vote_average"`
PosterPath string `json:"poster_path"`
BackdropPath string `json:"backdrop_path"`
}