diff --git a/config/swagger-output.json b/config/swagger-output.json index a69d96a..1515131 100644 --- a/config/swagger-output.json +++ b/config/swagger-output.json @@ -1,15 +1,28 @@ { - "openapi": "3.0.0", + "swagger": "2.0", "info": { "title": "ArtNe Server API 명세", "description": "ArtNe 서비스에 사용되는 다양한 API를 테스트합니다.", "version": "1.0.0" }, + "host": "localhost:3000", "servers": [ { "url": "http://localhost:3306" } ], + "basePath": "/", + "schemes": [ + "http" + ], + "securityDefinitions": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "in": "header", + "bearerFormat": "JWT" + } + }, "paths": { "/": { "get": { @@ -20,15 +33,502 @@ } } } - } - }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "in": "header", - "bearerFormat": "JWT" + }, + "/ping": { + "get": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/temp-token/{userId}": { + "post": { + "description": "", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/auth/oauth/kakao": { + "get": { + "description": "", + "responses": { + "default": { + "description": "" + } + } + } + }, + "/auth/oauth/kakao/redirect": { + "get": { + "description": "", + "parameters": [ + { + "name": "code", + "in": "query", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/auth/oauth/google": { + "get": { + "description": "", + "responses": { + "default": { + "description": "" + } + } + } + }, + "/auth/oauth/google/redirect": { + "get": { + "description": "", + "parameters": [ + { + "name": "code", + "in": "query", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/auth/signup": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "code": { + "example": "any" + }, + "social_type": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/auth/login": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "code": { + "example": "any" + }, + "social_type": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/api/userspace": { + "post": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "example": "any" + }, + "area": { + "example": "any" + } + } + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/api/artworks": { + "post": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "theme": { + "example": "any" + }, + "form": { + "example": "any" + }, + "title": { + "example": "any" + }, + "year": { + "example": "any" + }, + "genre": { + "example": "any" + }, + "material": { + "example": "any" + }, + "height": { + "example": "any" + }, + "width": { + "example": "any" + }, + "number": { + "example": "any" + }, + "frame": { + "example": "any" + }, + "description": { + "example": "any" + }, + "information": { + "example": "any" + } + } + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/api/artworks/{artworkId}": { + "get": { + "description": "", + "parameters": [ + { + "name": "artworkId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "authorization", + "in": "header", + "type": "string" + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/api/author/bank": { + "post": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bank_name": { + "example": "any" + }, + "account_holder": { + "example": "any" + }, + "account_number": { + "example": "any" + } + } + } + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/author/": { + "get": { + "description": "", + "parameters": [ + { + "name": "type", + "in": "query", + "type": "string" + }, + { + "name": "authorization", + "in": "header", + "type": "string" + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/author/profile/": { + "patch": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "attribute": { + "example": "any" + }, + "value": { + "example": "any" + } + } + } + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/main": { + "get": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/auction/available-artwork": { + "get": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/auction/register": { + "post": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "artwork_id": { + "example": "any" + }, + "start_price": { + "example": "any" + }, + "end_time": { + "example": "any" + } + } + } + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/auction/bid": { + "post": { + "description": "", + "parameters": [ + { + "name": "authorization", + "in": "header", + "type": "string" + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "auctionId": { + "example": "any" + }, + "bidPrice": { + "example": "any" + } + } + } + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/auction/": { + "get": { + "description": "", + "parameters": [ + { + "name": "sort", + "in": "query", + "type": "string" + } + ], + "responses": { + "default": { + "description": "" + } + } + } + }, + "/api/auction/{auctionId}": { + "get": { + "description": "", + "parameters": [ + { + "name": "auctionId", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "default": { + "description": "" + } + } } } } diff --git a/config/swagger.js b/config/swagger.js index fad760b..59f0619 100644 --- a/config/swagger.js +++ b/config/swagger.js @@ -1,6 +1,6 @@ // Swagger 설정 파일 -// ES6문법에서 Autogen을 사용하기 위한 변형 -const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' }); +// const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' }); +import swaggerAutogen from 'swagger-autogen' const PORT = 3306; // 사용하는 포트 번호에 맞게 변경 const options = { diff --git a/package-lock.json b/package-lock.json index 4b12f45..4270d01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4613,6 +4613,7 @@ "version": "2.23.7", "resolved": "https://registry.npmjs.org/swagger-autogen/-/swagger-autogen-2.23.7.tgz", "integrity": "sha512-vr7uRmuV0DCxWc0wokLJAwX3GwQFJ0jwN+AWk0hKxre2EZwusnkGSGdVFd82u7fQLgwSTnbWkxUL7HXuz5LTZQ==", + "license": "MIT", "dependencies": { "acorn": "^7.4.1", "deepmerge": "^4.2.2", @@ -4740,6 +4741,7 @@ "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-5.0.1.tgz", "integrity": "sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==", "dev": true, + "license": "MIT", "dependencies": { "swagger-ui-dist": ">=5.0.0" },