From ac0e62a3f5d7106a7eed8dde032a562bcedd8eab Mon Sep 17 00:00:00 2001 From: 0BVer Date: Sun, 27 Aug 2023 11:16:22 +0900 Subject: [PATCH] feat : movie review --- .gitignore | 2 +- movieReview/docs/docs.go | 531 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 532 insertions(+), 1 deletion(-) create mode 100644 movieReview/docs/docs.go diff --git a/.gitignore b/.gitignore index dcdea533..57f1cb2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/movieReview/.idea/ +/.idea/ \ No newline at end of file diff --git a/movieReview/docs/docs.go b/movieReview/docs/docs.go new file mode 100644 index 00000000..7ef2b8fc --- /dev/null +++ b/movieReview/docs/docs.go @@ -0,0 +1,531 @@ +// Code generated by swaggo/swag. DO NOT EDIT. + +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/movies": { + "get": { + "description": "Find all movies", + "produces": [ + "application/json" + ], + "tags": [ + "movies" + ], + "parameters": [ + { + "type": "string", + "description": "Genre", + "name": "genre", + "in": "query" + }, + { + "type": "string", + "description": "IsShowing", + "name": "isShowing", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/movieReview_movie_domain.Response" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "post": { + "description": "Create a movie", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "movies" + ], + "parameters": [ + { + "description": "Movie", + "name": "movie", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/movieReview_movie_domain.CreateRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/movieReview_movie_domain.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/movies/score": { + "get": { + "description": "Find all movies by score", + "produces": [ + "application/json" + ], + "tags": [ + "movies" + ], + "parameters": [ + { + "type": "integer", + "description": "Page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "Size", + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ScoreRankResponse" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/movies/{id}": { + "get": { + "description": "Find a movie by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "movies" + ], + "parameters": [ + { + "type": "string", + "description": "ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/movieReview_movie_domain.Response" + } + }, + "404": { + "description": "Not Found", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "put": { + "description": "Update a movie", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "movies" + ], + "parameters": [ + { + "type": "string", + "description": "ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Movie", + "name": "movie", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/movieReview_movie_domain.CreateRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/movieReview_movie_domain.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "404": { + "description": "Not Found", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "delete": { + "description": "Delete a movie", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "movies" + ], + "parameters": [ + { + "type": "string", + "description": "ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/reviews": { + "get": { + "description": "Find all reviews by movie id", + "produces": [ + "application/json" + ], + "tags": [ + "reviews" + ], + "parameters": [ + { + "type": "string", + "description": "Movie ID", + "name": "movieId", + "in": "query" + }, + { + "type": "string", + "description": "Score Cap", + "name": "scoreCap", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/movieReview_review_domain.Response" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "404": { + "description": "Not Found", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "post": { + "description": "Create a review", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "reviews" + ], + "parameters": [ + { + "description": "Review", + "name": "review", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/movieReview_review_domain.CreateRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/movieReview_review_domain.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + } + }, + "definitions": { + "domain.ScoreRankResponse": { + "type": "object", + "properties": { + "createdAt": { + "type": "string" + }, + "endAt": { + "type": "string" + }, + "genre": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "isShowing": { + "type": "boolean" + }, + "releasedAt": { + "type": "string" + }, + "scoreAvg": { + "type": "number" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + }, + "movieReview_movie_domain.CreateRequest": { + "type": "object", + "required": [ + "endAt", + "genre", + "releasedAt", + "title" + ], + "properties": { + "endAt": { + "type": "string" + }, + "genre": { + "type": "string" + }, + "releasedAt": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "movieReview_movie_domain.Response": { + "type": "object", + "properties": { + "createdAt": { + "type": "string" + }, + "endAt": { + "type": "string" + }, + "genre": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "isShowing": { + "type": "boolean" + }, + "releasedAt": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + }, + "movieReview_review_domain.CreateRequest": { + "type": "object", + "required": [ + "comment", + "movieID", + "score" + ], + "properties": { + "comment": { + "type": "string" + }, + "movieID": { + "type": "integer" + }, + "score": { + "type": "integer", + "maximum": 5, + "minimum": 0 + } + } + }, + "movieReview_review_domain.Response": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "movieId": { + "type": "integer" + }, + "score": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + } + } + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "1", + Host: "localhost:8080", + BasePath: "/api/v1", + Schemes: []string{}, + Title: "Movie Review API", + Description: "This is a Movie Review API server.", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +}