mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-27 17:38:51 +05:00
- /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
782 lines
24 KiB
JSON
782 lines
24 KiB
JSON
{
|
||
"swagger": "2.0",
|
||
"info": {
|
||
"description": "API для работы с фильмами",
|
||
"title": "Neo Movies API",
|
||
"contact": {},
|
||
"version": "1.0"
|
||
},
|
||
"host": "localhost:8080",
|
||
"basePath": "/",
|
||
"paths": {
|
||
"/bridge/tmdb/discover/movie": {
|
||
"get": {
|
||
"description": "Get a list of movies based on filters",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Discover movies",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.TMDBMoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/discover/tv": {
|
||
"get": {
|
||
"description": "Get a list of TV shows based on filters",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Discover TV shows",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.TMDBMoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/movie/popular": {
|
||
"get": {
|
||
"description": "Get a list of popular movies directly from TMDB",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Get TMDB popular movies",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.TMDBMoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/movie/top_rated": {
|
||
"get": {
|
||
"description": "Get a list of top rated movies directly from TMDB",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Get TMDB top rated movies",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.TMDBMoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/movie/upcoming": {
|
||
"get": {
|
||
"description": "Get a list of upcoming movies directly from TMDB",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Get TMDB upcoming movies",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.TMDBMoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/movie/{id}": {
|
||
"get": {
|
||
"description": "Get detailed information about a specific movie directly from TMDB",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Get TMDB movie details",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Movie ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/tmdb.Movie"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/movie/{id}/external_ids": {
|
||
"get": {
|
||
"description": "Get external IDs (IMDb, Facebook, Instagram, Twitter) for a specific movie",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Get TMDB movie external IDs",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Movie ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/tmdb.ExternalIDs"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/search/movie": {
|
||
"get": {
|
||
"description": "Search for movies directly in TMDB",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Search TMDB movies",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Search query",
|
||
"name": "query",
|
||
"in": "query",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/tmdb.MoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/search/tv": {
|
||
"get": {
|
||
"description": "Search for TV shows directly in TMDB",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Search TMDB TV shows",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Search query",
|
||
"name": "query",
|
||
"in": "query",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/tmdb.TVSearchResults"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/bridge/tmdb/tv/{id}/external_ids": {
|
||
"get": {
|
||
"description": "Get external IDs (IMDb, Facebook, Instagram, Twitter) for a specific TV show",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"tmdb"
|
||
],
|
||
"summary": "Get TMDB TV show external IDs",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "TV Show ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/tmdb.ExternalIDs"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/movies/popular": {
|
||
"get": {
|
||
"description": "Get a list of popular movies",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"movies"
|
||
],
|
||
"summary": "Get popular movies",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.MoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/movies/search": {
|
||
"get": {
|
||
"description": "Search for movies",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"movies"
|
||
],
|
||
"summary": "Search movies",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Search query",
|
||
"name": "query",
|
||
"in": "query",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.MoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/movies/top-rated": {
|
||
"get": {
|
||
"description": "Get a list of top rated movies",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"movies"
|
||
],
|
||
"summary": "Get top rated movies",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.MoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/movies/upcoming": {
|
||
"get": {
|
||
"description": "Get a list of upcoming movies",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"movies"
|
||
],
|
||
"summary": "Get upcoming movies",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number (default: 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.MoviesResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/movies/{id}": {
|
||
"get": {
|
||
"description": "Get detailed information about a specific movie",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"movies"
|
||
],
|
||
"summary": "Get movie details",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Movie ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.MovieDetails"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"definitions": {
|
||
"api.Genre": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.Movie": {
|
||
"type": "object",
|
||
"properties": {
|
||
"backdrop_path": {
|
||
"type": "string"
|
||
},
|
||
"genres": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.Genre"
|
||
}
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"overview": {
|
||
"type": "string"
|
||
},
|
||
"poster_path": {
|
||
"type": "string"
|
||
},
|
||
"release_date": {
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"vote_average": {
|
||
"type": "number"
|
||
}
|
||
}
|
||
},
|
||
"api.MovieDetails": {
|
||
"type": "object",
|
||
"properties": {
|
||
"backdrop_path": {
|
||
"type": "string"
|
||
},
|
||
"budget": {
|
||
"type": "integer"
|
||
},
|
||
"genres": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.Genre"
|
||
}
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"overview": {
|
||
"type": "string"
|
||
},
|
||
"poster_path": {
|
||
"type": "string"
|
||
},
|
||
"release_date": {
|
||
"type": "string"
|
||
},
|
||
"revenue": {
|
||
"type": "integer"
|
||
},
|
||
"runtime": {
|
||
"type": "integer"
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
},
|
||
"tagline": {
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"vote_average": {
|
||
"type": "number"
|
||
}
|
||
}
|
||
},
|
||
"api.MoviesResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"page": {
|
||
"type": "integer"
|
||
},
|
||
"results": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.Movie"
|
||
}
|
||
},
|
||
"total_pages": {
|
||
"type": "integer"
|
||
},
|
||
"total_results": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.TMDBMoviesResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"page": {
|
||
"type": "integer"
|
||
},
|
||
"results": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.Movie"
|
||
}
|
||
},
|
||
"total_pages": {
|
||
"type": "integer"
|
||
},
|
||
"total_results": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"tmdb.ExternalIDs": {
|
||
"type": "object",
|
||
"properties": {
|
||
"facebook_id": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"imdb_id": {
|
||
"type": "string"
|
||
},
|
||
"instagram_id": {
|
||
"type": "string"
|
||
},
|
||
"twitter_id": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"tmdb.Genre": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"tmdb.Movie": {
|
||
"type": "object",
|
||
"properties": {
|
||
"backdrop_path": {
|
||
"type": "string"
|
||
},
|
||
"genres": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/tmdb.Genre"
|
||
}
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"overview": {
|
||
"type": "string"
|
||
},
|
||
"poster_path": {
|
||
"type": "string"
|
||
},
|
||
"release_date": {
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"vote_average": {
|
||
"type": "number"
|
||
}
|
||
}
|
||
},
|
||
"tmdb.MoviesResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"page": {
|
||
"type": "integer"
|
||
},
|
||
"results": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/tmdb.Movie"
|
||
}
|
||
},
|
||
"total_pages": {
|
||
"type": "integer"
|
||
},
|
||
"total_results": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"tmdb.TV": {
|
||
"type": "object",
|
||
"properties": {
|
||
"backdrop_path": {
|
||
"type": "string"
|
||
},
|
||
"first_air_date": {
|
||
"type": "string"
|
||
},
|
||
"genre_ids": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"original_language": {
|
||
"type": "string"
|
||
},
|
||
"original_name": {
|
||
"type": "string"
|
||
},
|
||
"overview": {
|
||
"type": "string"
|
||
},
|
||
"popularity": {
|
||
"type": "number"
|
||
},
|
||
"poster_path": {
|
||
"type": "string"
|
||
},
|
||
"vote_average": {
|
||
"type": "number"
|
||
},
|
||
"vote_count": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"tmdb.TVSearchResults": {
|
||
"type": "object",
|
||
"properties": {
|
||
"page": {
|
||
"type": "integer"
|
||
},
|
||
"results": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/tmdb.TV"
|
||
}
|
||
},
|
||
"total_pages": {
|
||
"type": "integer"
|
||
},
|
||
"total_results": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
} |