diff --git a/build.gradle b/build.gradle index 33e2dfb..19d6b59 100644 --- a/build.gradle +++ b/build.gradle @@ -35,9 +35,8 @@ dependencies { testImplementation 'org.springframework.security:spring-security-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - // postgreSql - runtimeOnly 'org.postgresql:postgresql' - implementation 'org.postgresql:postgresql:42.7.3' + // mysql + runtimeOnly 'com.mysql:mysql-connector-j' // jwt implementation 'io.jsonwebtoken:jjwt-api:0.11.5' diff --git a/docker-compose.yml b/docker-compose.yml index 4ced504..9fb935e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,13 @@ services: db: - image: postgres:15 + image: mysql:8.0 restart: unless-stopped container_name: runners_db env_file: .env ports: - - "5432:5432" + - "3306:3306" volumes: - - runners_db:/var/lib/postgresql/data + - runners_db:/var/lib/mysql app: image: openjdk:17-slim @@ -25,4 +25,3 @@ services: volumes: runners_db: - diff --git a/src/main/java/run/backend/domain/auth/controller/AuthController.java b/src/main/java/run/backend/domain/auth/controller/AuthController.java index e6bb377..57af328 100644 --- a/src/main/java/run/backend/domain/auth/controller/AuthController.java +++ b/src/main/java/run/backend/domain/auth/controller/AuthController.java @@ -1,5 +1,6 @@ package run.backend.domain.auth.controller; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -24,6 +25,7 @@ public class AuthController { private final AuthService authService; + @Operation(summary = "소셜 로그인", description = "소셜 로그인 요청 API 입니다.") @PostMapping("/{provider}") public ResponseEntity> socialLogin( @PathVariable String provider, @RequestBody CodeRequest codeRequest) { @@ -33,6 +35,7 @@ public ResponseEntity> socialLogin( return ResponseEntity.ok(new CommonResponse<>("소셜 로그인 요청에 성공했습니다.", response)); } + @Operation(summary = "온보딩 유저 정보 입력", description = "온보딩 유저 정보를 입력하는 API 입니다.") @PostMapping("/signup") public ResponseEntity> signup( @RequestPart("signupRequest") SignupRequest signupRequest, @@ -43,6 +46,7 @@ public ResponseEntity> signup( return ResponseEntity.ok(new CommonResponse<>("회원가입이 완료되었습니다.", response)); } + @Operation(summary = "토큰 재발급", description = "액세스 토큰 재발급 API 입니다.") @PostMapping("/refresh") public ResponseEntity> refresh( @RequestHeader("Authorization") String authorizationHeader) { diff --git a/src/main/java/run/backend/domain/file/controller/FileController.java b/src/main/java/run/backend/domain/file/controller/FileController.java index 7c7be45..6d7b0b8 100644 --- a/src/main/java/run/backend/domain/file/controller/FileController.java +++ b/src/main/java/run/backend/domain/file/controller/FileController.java @@ -1,5 +1,6 @@ package run.backend.domain.file.controller; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.core.io.Resource; @@ -23,6 +24,7 @@ public class FileController { private final FileService fileService; + @Operation(summary = "프로필 이미지 조회", description = "유저 프로필 이미지를 조회하는 API 입니다.") @GetMapping("/profiles/{filename}") public ResponseEntity getProfileImage(@PathVariable String filename) { Resource resource = fileService.getFileResource(filename); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d9b36eb..2af2f57 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,10 +3,10 @@ spring: import: optional:file:.env[.properties] datasource: - url: jdbc:postgresql://${POSTGRES_HOST}:5432/${POSTGRES_DB} - username: ${POSTGRES_USER} - password: ${POSTGRES_PASSWORD} - driver-class-name: org.postgresql.Driver + url: jdbc:mysql://${MYSQL_HOST}:3306/${MYSQL_DB}?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8&allowPublicKeyRetrieval=true + username: ${MYSQL_USER} + password: ${MYSQL_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver web: resources: @@ -15,9 +15,14 @@ spring: - file:${file.upload.dir}/ jpa: - database: postgresql + database: mysql hibernate: ddl-auto: create + properties: + hibernate: + dialect: org.hibernate.dialect.MySQLDialect + format_sql: true + show-sql: true servlet: multipart: