From 854268f59080ac7cf9fbf9bb8ca2b549e88ec57d Mon Sep 17 00:00:00 2001 From: JunHyuk Yu Date: Fri, 16 Aug 2024 00:58:39 +0900 Subject: [PATCH 1/5] =?UTF-8?q?chore:=201.=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EC=9D=B4=EB=A6=84=20demo=20->=20zarinatta-server?= =?UTF-8?q?=202.=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EB=A6=AC=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A7=81=203.=20h2=20DB=20=EC=A2=85=EC=86=8D=EC=84=B1?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 3 ++- settings.gradle | 2 +- src/main/java/{oauth => server}/Application.java | 2 +- .../{ => server}/oauth/auth/AuthController.java | 5 +---- .../java/{ => server}/oauth/auth/AuthService.java | 14 ++++++-------- .../java/{ => server}/oauth/auth/JwtService.java | 6 +++--- .../java/{ => server}/oauth/auth/JwtToken.java | 2 +- .../{ => server}/oauth/auth/KakaoProfileDto.java | 2 +- .../java/{ => server}/oauth/auth/LoginDto.java | 2 +- .../java/{ => server}/oauth/auth/RedirectDto.java | 2 +- src/main/java/{ => server}/oauth/auth/TestDto.java | 2 +- .../{ => server}/oauth/auth/TokenRequestDto.java | 2 +- .../{ => server}/oauth/auth/TokenResponseDto.java | 2 +- .../java/{ => server}/oauth/auth/UserInfoDto.java | 2 +- .../{ => server}/oauth/config/FilterConfig.java | 6 +++--- .../{ => server}/oauth/config/RedisConfig.java | 2 +- .../{ => server}/oauth/config/RedisService.java | 2 +- .../java/{ => server}/oauth/config/WebConfig.java | 2 +- .../oauth/exception/ZarinattaException.java | 2 +- .../oauth/exception/ZarinattaExceptionType.java | 2 +- .../oauth/filter/TokenValidationFilter.java | 6 +++--- .../oauth/noti/ApiResponseWrapper.java | 2 +- .../{ => server}/oauth/noti/FcmMessageDto.java | 2 +- .../java/{ => server}/oauth/noti/FcmSendDto.java | 2 +- .../{ => server}/oauth/noti/NotiController.java | 3 +-- .../java/{ => server}/oauth/noti/NotiService.java | 2 +- .../java/{ => server}/oauth/sse/MessageDto.java | 2 +- .../{ => server}/oauth/sse/RedisController.java | 2 +- .../{ => server}/oauth/sse/RedisPubService.java | 2 +- .../oauth/sse/RedisPublisherService.java | 2 +- .../oauth/sse/RedisSubscriberListener.java | 2 +- src/main/java/{ => server}/oauth/user/User.java | 2 +- .../{ => server}/oauth/user/UserController.java | 5 ++--- .../java/{ => server}/oauth/user/UserInputDto.java | 2 +- .../{ => server}/oauth/user/UserRepository.java | 4 +--- .../java/{ => server}/oauth/user/UserService.java | 9 ++++----- .../{ => server}/oauth/user/UserUpdateDto.java | 2 +- .../java/{oauth => server}/ApplicationTests.java | 2 +- 38 files changed, 54 insertions(+), 63 deletions(-) rename src/main/java/{oauth => server}/Application.java (96%) rename src/main/java/{ => server}/oauth/auth/AuthController.java (96%) rename src/main/java/{ => server}/oauth/auth/AuthService.java (96%) rename src/main/java/{ => server}/oauth/auth/JwtService.java (95%) rename src/main/java/{ => server}/oauth/auth/JwtToken.java (82%) rename src/main/java/{ => server}/oauth/auth/KakaoProfileDto.java (96%) rename src/main/java/{ => server}/oauth/auth/LoginDto.java (90%) rename src/main/java/{ => server}/oauth/auth/RedirectDto.java (81%) rename src/main/java/{ => server}/oauth/auth/TestDto.java (80%) rename src/main/java/{ => server}/oauth/auth/TokenRequestDto.java (87%) rename src/main/java/{ => server}/oauth/auth/TokenResponseDto.java (84%) rename src/main/java/{ => server}/oauth/auth/UserInfoDto.java (84%) rename src/main/java/{ => server}/oauth/config/FilterConfig.java (86%) rename src/main/java/{ => server}/oauth/config/RedisConfig.java (98%) rename src/main/java/{ => server}/oauth/config/RedisService.java (97%) rename src/main/java/{ => server}/oauth/config/WebConfig.java (95%) rename src/main/java/{ => server}/oauth/exception/ZarinattaException.java (92%) rename src/main/java/{ => server}/oauth/exception/ZarinattaExceptionType.java (95%) rename src/main/java/{ => server}/oauth/filter/TokenValidationFilter.java (95%) rename src/main/java/{ => server}/oauth/noti/ApiResponseWrapper.java (87%) rename src/main/java/{ => server}/oauth/noti/FcmMessageDto.java (95%) rename src/main/java/{ => server}/oauth/noti/FcmSendDto.java (91%) rename src/main/java/{ => server}/oauth/noti/NotiController.java (93%) rename src/main/java/{ => server}/oauth/noti/NotiService.java (99%) rename src/main/java/{ => server}/oauth/sse/MessageDto.java (93%) rename src/main/java/{ => server}/oauth/sse/RedisController.java (97%) rename src/main/java/{ => server}/oauth/sse/RedisPubService.java (96%) rename src/main/java/{ => server}/oauth/sse/RedisPublisherService.java (95%) rename src/main/java/{ => server}/oauth/sse/RedisSubscriberListener.java (97%) rename src/main/java/{ => server}/oauth/user/User.java (96%) rename src/main/java/{ => server}/oauth/user/UserController.java (93%) rename src/main/java/{ => server}/oauth/user/UserInputDto.java (83%) rename src/main/java/{ => server}/oauth/user/UserRepository.java (95%) rename src/main/java/{ => server}/oauth/user/UserService.java (88%) rename src/main/java/{ => server}/oauth/user/UserUpdateDto.java (88%) rename src/test/java/{oauth => server}/ApplicationTests.java (91%) diff --git a/build.gradle b/build.gradle index 54a07c7..bb5cf96 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { id 'io.spring.dependency-management' version '1.1.5' } -group = 'oauth' +group = 'com.zarinatta' version = '0.0.1-SNAPSHOT' java { @@ -40,6 +40,7 @@ dependencies { compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' + runtimeOnly 'com.h2database:h2' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } diff --git a/settings.gradle b/settings.gradle index 0a383dd..d16b2cd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'demo' +rootProject.name = 'zarinatta-server' diff --git a/src/main/java/oauth/Application.java b/src/main/java/server/Application.java similarity index 96% rename from src/main/java/oauth/Application.java rename to src/main/java/server/Application.java index 3eb6af3..22a5836 100644 --- a/src/main/java/oauth/Application.java +++ b/src/main/java/server/Application.java @@ -1,4 +1,4 @@ -package oauth; +package server; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/oauth/auth/AuthController.java b/src/main/java/server/oauth/auth/AuthController.java similarity index 96% rename from src/main/java/oauth/auth/AuthController.java rename to src/main/java/server/oauth/auth/AuthController.java index 4402f4c..c979cce 100644 --- a/src/main/java/oauth/auth/AuthController.java +++ b/src/main/java/server/oauth/auth/AuthController.java @@ -1,14 +1,11 @@ -package oauth.auth; +package server.oauth.auth; -import jakarta.servlet.http.Cookie; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; -import org.apache.coyote.Response; import org.springframework.http.*; import org.springframework.web.bind.annotation.*; -import java.io.UnsupportedEncodingException; import java.util.Map; @RestController diff --git a/src/main/java/oauth/auth/AuthService.java b/src/main/java/server/oauth/auth/AuthService.java similarity index 96% rename from src/main/java/oauth/auth/AuthService.java rename to src/main/java/server/oauth/auth/AuthService.java index d4da3fb..e3f19ec 100644 --- a/src/main/java/oauth/auth/AuthService.java +++ b/src/main/java/server/oauth/auth/AuthService.java @@ -1,12 +1,12 @@ -package oauth.auth; +package server.oauth.auth; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; -import oauth.config.RedisService; -import oauth.exception.ZarinattaException; -import oauth.exception.ZarinattaExceptionType; -import oauth.user.UserInputDto; -import oauth.user.UserService; +import server.oauth.config.RedisService; +import server.oauth.exception.ZarinattaException; +import server.oauth.exception.ZarinattaExceptionType; +import server.oauth.user.UserInputDto; +import server.oauth.user.UserService; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -18,8 +18,6 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; -import java.util.Optional; - @Service @RequiredArgsConstructor public class AuthService { diff --git a/src/main/java/oauth/auth/JwtService.java b/src/main/java/server/oauth/auth/JwtService.java similarity index 95% rename from src/main/java/oauth/auth/JwtService.java rename to src/main/java/server/oauth/auth/JwtService.java index 84e3e2a..d8c0def 100644 --- a/src/main/java/oauth/auth/JwtService.java +++ b/src/main/java/server/oauth/auth/JwtService.java @@ -1,10 +1,10 @@ -package oauth.auth; +package server.oauth.auth; import io.jsonwebtoken.*; import jakarta.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; -import oauth.exception.ZarinattaException; -import oauth.exception.ZarinattaExceptionType; +import server.oauth.exception.ZarinattaException; +import server.oauth.exception.ZarinattaExceptionType; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; diff --git a/src/main/java/oauth/auth/JwtToken.java b/src/main/java/server/oauth/auth/JwtToken.java similarity index 82% rename from src/main/java/oauth/auth/JwtToken.java rename to src/main/java/server/oauth/auth/JwtToken.java index d598c39..04943bf 100644 --- a/src/main/java/oauth/auth/JwtToken.java +++ b/src/main/java/server/oauth/auth/JwtToken.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/auth/KakaoProfileDto.java b/src/main/java/server/oauth/auth/KakaoProfileDto.java similarity index 96% rename from src/main/java/oauth/auth/KakaoProfileDto.java rename to src/main/java/server/oauth/auth/KakaoProfileDto.java index 96d03b2..fce39c9 100644 --- a/src/main/java/oauth/auth/KakaoProfileDto.java +++ b/src/main/java/server/oauth/auth/KakaoProfileDto.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/auth/LoginDto.java b/src/main/java/server/oauth/auth/LoginDto.java similarity index 90% rename from src/main/java/oauth/auth/LoginDto.java rename to src/main/java/server/oauth/auth/LoginDto.java index fc18e9f..657cdfe 100644 --- a/src/main/java/oauth/auth/LoginDto.java +++ b/src/main/java/server/oauth/auth/LoginDto.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/auth/RedirectDto.java b/src/main/java/server/oauth/auth/RedirectDto.java similarity index 81% rename from src/main/java/oauth/auth/RedirectDto.java rename to src/main/java/server/oauth/auth/RedirectDto.java index a0704d5..f9b39d4 100644 --- a/src/main/java/oauth/auth/RedirectDto.java +++ b/src/main/java/server/oauth/auth/RedirectDto.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/auth/TestDto.java b/src/main/java/server/oauth/auth/TestDto.java similarity index 80% rename from src/main/java/oauth/auth/TestDto.java rename to src/main/java/server/oauth/auth/TestDto.java index de1b42f..f272236 100644 --- a/src/main/java/oauth/auth/TestDto.java +++ b/src/main/java/server/oauth/auth/TestDto.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/auth/TokenRequestDto.java b/src/main/java/server/oauth/auth/TokenRequestDto.java similarity index 87% rename from src/main/java/oauth/auth/TokenRequestDto.java rename to src/main/java/server/oauth/auth/TokenRequestDto.java index f7fcc7d..8cec420 100644 --- a/src/main/java/oauth/auth/TokenRequestDto.java +++ b/src/main/java/server/oauth/auth/TokenRequestDto.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/auth/TokenResponseDto.java b/src/main/java/server/oauth/auth/TokenResponseDto.java similarity index 84% rename from src/main/java/oauth/auth/TokenResponseDto.java rename to src/main/java/server/oauth/auth/TokenResponseDto.java index aa7f8cc..a095e91 100644 --- a/src/main/java/oauth/auth/TokenResponseDto.java +++ b/src/main/java/server/oauth/auth/TokenResponseDto.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/auth/UserInfoDto.java b/src/main/java/server/oauth/auth/UserInfoDto.java similarity index 84% rename from src/main/java/oauth/auth/UserInfoDto.java rename to src/main/java/server/oauth/auth/UserInfoDto.java index 4d8eb24..7f7e84d 100644 --- a/src/main/java/oauth/auth/UserInfoDto.java +++ b/src/main/java/server/oauth/auth/UserInfoDto.java @@ -1,4 +1,4 @@ -package oauth.auth; +package server.oauth.auth; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/config/FilterConfig.java b/src/main/java/server/oauth/config/FilterConfig.java similarity index 86% rename from src/main/java/oauth/config/FilterConfig.java rename to src/main/java/server/oauth/config/FilterConfig.java index d24e41e..ffce57c 100644 --- a/src/main/java/oauth/config/FilterConfig.java +++ b/src/main/java/server/oauth/config/FilterConfig.java @@ -1,7 +1,7 @@ -package oauth.config; +package server.oauth.config; -import oauth.auth.JwtService; -import oauth.filter.TokenValidationFilter; +import server.oauth.auth.JwtService; +import server.oauth.filter.TokenValidationFilter; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/oauth/config/RedisConfig.java b/src/main/java/server/oauth/config/RedisConfig.java similarity index 98% rename from src/main/java/oauth/config/RedisConfig.java rename to src/main/java/server/oauth/config/RedisConfig.java index 7125b56..e517b66 100644 --- a/src/main/java/oauth/config/RedisConfig.java +++ b/src/main/java/server/oauth/config/RedisConfig.java @@ -1,4 +1,4 @@ -package oauth.config; +package server.oauth.config; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/oauth/config/RedisService.java b/src/main/java/server/oauth/config/RedisService.java similarity index 97% rename from src/main/java/oauth/config/RedisService.java rename to src/main/java/server/oauth/config/RedisService.java index 728375a..8fe489e 100644 --- a/src/main/java/oauth/config/RedisService.java +++ b/src/main/java/server/oauth/config/RedisService.java @@ -1,4 +1,4 @@ -package oauth.config; +package server.oauth.config; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/oauth/config/WebConfig.java b/src/main/java/server/oauth/config/WebConfig.java similarity index 95% rename from src/main/java/oauth/config/WebConfig.java rename to src/main/java/server/oauth/config/WebConfig.java index de85bd8..594eebf 100644 --- a/src/main/java/oauth/config/WebConfig.java +++ b/src/main/java/server/oauth/config/WebConfig.java @@ -1,4 +1,4 @@ -package oauth.config; +package server.oauth.config; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; diff --git a/src/main/java/oauth/exception/ZarinattaException.java b/src/main/java/server/oauth/exception/ZarinattaException.java similarity index 92% rename from src/main/java/oauth/exception/ZarinattaException.java rename to src/main/java/server/oauth/exception/ZarinattaException.java index 372fa13..06d5be3 100644 --- a/src/main/java/oauth/exception/ZarinattaException.java +++ b/src/main/java/server/oauth/exception/ZarinattaException.java @@ -1,4 +1,4 @@ -package oauth.exception; +package server.oauth.exception; import lombok.Getter; diff --git a/src/main/java/oauth/exception/ZarinattaExceptionType.java b/src/main/java/server/oauth/exception/ZarinattaExceptionType.java similarity index 95% rename from src/main/java/oauth/exception/ZarinattaExceptionType.java rename to src/main/java/server/oauth/exception/ZarinattaExceptionType.java index 04e5b5e..9c1acea 100644 --- a/src/main/java/oauth/exception/ZarinattaExceptionType.java +++ b/src/main/java/server/oauth/exception/ZarinattaExceptionType.java @@ -1,4 +1,4 @@ -package oauth.exception; +package server.oauth.exception; import lombok.Getter; diff --git a/src/main/java/oauth/filter/TokenValidationFilter.java b/src/main/java/server/oauth/filter/TokenValidationFilter.java similarity index 95% rename from src/main/java/oauth/filter/TokenValidationFilter.java rename to src/main/java/server/oauth/filter/TokenValidationFilter.java index af0f928..230411c 100644 --- a/src/main/java/oauth/filter/TokenValidationFilter.java +++ b/src/main/java/server/oauth/filter/TokenValidationFilter.java @@ -1,4 +1,4 @@ -package oauth.filter; +package server.oauth.filter; import jakarta.servlet.Filter; import jakarta.servlet.FilterChain; @@ -10,8 +10,8 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; -import oauth.auth.JwtService; -import oauth.exception.ZarinattaException; +import server.oauth.auth.JwtService; +import server.oauth.exception.ZarinattaException; import java.io.IOException; import java.util.ArrayList; diff --git a/src/main/java/oauth/noti/ApiResponseWrapper.java b/src/main/java/server/oauth/noti/ApiResponseWrapper.java similarity index 87% rename from src/main/java/oauth/noti/ApiResponseWrapper.java rename to src/main/java/server/oauth/noti/ApiResponseWrapper.java index c3e8079..276c9d4 100644 --- a/src/main/java/oauth/noti/ApiResponseWrapper.java +++ b/src/main/java/server/oauth/noti/ApiResponseWrapper.java @@ -1,4 +1,4 @@ -package oauth.noti; +package server.oauth.noti; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/noti/FcmMessageDto.java b/src/main/java/server/oauth/noti/FcmMessageDto.java similarity index 95% rename from src/main/java/oauth/noti/FcmMessageDto.java rename to src/main/java/server/oauth/noti/FcmMessageDto.java index 3ae955c..81f1fc5 100644 --- a/src/main/java/oauth/noti/FcmMessageDto.java +++ b/src/main/java/server/oauth/noti/FcmMessageDto.java @@ -1,4 +1,4 @@ -package oauth.noti; +package server.oauth.noti; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/oauth/noti/FcmSendDto.java b/src/main/java/server/oauth/noti/FcmSendDto.java similarity index 91% rename from src/main/java/oauth/noti/FcmSendDto.java rename to src/main/java/server/oauth/noti/FcmSendDto.java index f0e02aa..d26ac95 100644 --- a/src/main/java/oauth/noti/FcmSendDto.java +++ b/src/main/java/server/oauth/noti/FcmSendDto.java @@ -1,4 +1,4 @@ -package oauth.noti; +package server.oauth.noti; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/oauth/noti/NotiController.java b/src/main/java/server/oauth/noti/NotiController.java similarity index 93% rename from src/main/java/oauth/noti/NotiController.java rename to src/main/java/server/oauth/noti/NotiController.java index f102386..42fbdd0 100644 --- a/src/main/java/oauth/noti/NotiController.java +++ b/src/main/java/server/oauth/noti/NotiController.java @@ -1,4 +1,4 @@ -package oauth.noti; +package server.oauth.noti; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -7,7 +7,6 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.io.IOException; diff --git a/src/main/java/oauth/noti/NotiService.java b/src/main/java/server/oauth/noti/NotiService.java similarity index 99% rename from src/main/java/oauth/noti/NotiService.java rename to src/main/java/server/oauth/noti/NotiService.java index 76d4815..137f97e 100644 --- a/src/main/java/oauth/noti/NotiService.java +++ b/src/main/java/server/oauth/noti/NotiService.java @@ -1,4 +1,4 @@ -package oauth.noti; +package server.oauth.noti; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/oauth/sse/MessageDto.java b/src/main/java/server/oauth/sse/MessageDto.java similarity index 93% rename from src/main/java/oauth/sse/MessageDto.java rename to src/main/java/server/oauth/sse/MessageDto.java index 4661677..41d07d3 100644 --- a/src/main/java/oauth/sse/MessageDto.java +++ b/src/main/java/server/oauth/sse/MessageDto.java @@ -1,4 +1,4 @@ -package oauth.sse; +package server.oauth.sse; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/oauth/sse/RedisController.java b/src/main/java/server/oauth/sse/RedisController.java similarity index 97% rename from src/main/java/oauth/sse/RedisController.java rename to src/main/java/server/oauth/sse/RedisController.java index 20ae1e0..d655633 100644 --- a/src/main/java/oauth/sse/RedisController.java +++ b/src/main/java/server/oauth/sse/RedisController.java @@ -1,4 +1,4 @@ -package oauth.sse; +package server.oauth.sse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/oauth/sse/RedisPubService.java b/src/main/java/server/oauth/sse/RedisPubService.java similarity index 96% rename from src/main/java/oauth/sse/RedisPubService.java rename to src/main/java/server/oauth/sse/RedisPubService.java index 94c24fd..09ffde3 100644 --- a/src/main/java/oauth/sse/RedisPubService.java +++ b/src/main/java/server/oauth/sse/RedisPubService.java @@ -1,4 +1,4 @@ -package oauth.sse; +package server.oauth.sse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/oauth/sse/RedisPublisherService.java b/src/main/java/server/oauth/sse/RedisPublisherService.java similarity index 95% rename from src/main/java/oauth/sse/RedisPublisherService.java rename to src/main/java/server/oauth/sse/RedisPublisherService.java index 486bc4f..c575c5c 100644 --- a/src/main/java/oauth/sse/RedisPublisherService.java +++ b/src/main/java/server/oauth/sse/RedisPublisherService.java @@ -1,4 +1,4 @@ -package oauth.sse; +package server.oauth.sse; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.RedisTemplate; diff --git a/src/main/java/oauth/sse/RedisSubscriberListener.java b/src/main/java/server/oauth/sse/RedisSubscriberListener.java similarity index 97% rename from src/main/java/oauth/sse/RedisSubscriberListener.java rename to src/main/java/server/oauth/sse/RedisSubscriberListener.java index 569ad0c..ddfa860 100644 --- a/src/main/java/oauth/sse/RedisSubscriberListener.java +++ b/src/main/java/server/oauth/sse/RedisSubscriberListener.java @@ -1,4 +1,4 @@ -package oauth.sse; +package server.oauth.sse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/oauth/user/User.java b/src/main/java/server/oauth/user/User.java similarity index 96% rename from src/main/java/oauth/user/User.java rename to src/main/java/server/oauth/user/User.java index 51bfc56..fbfa9ac 100644 --- a/src/main/java/oauth/user/User.java +++ b/src/main/java/server/oauth/user/User.java @@ -1,4 +1,4 @@ -package oauth.user; +package server.oauth.user; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/oauth/user/UserController.java b/src/main/java/server/oauth/user/UserController.java similarity index 93% rename from src/main/java/oauth/user/UserController.java rename to src/main/java/server/oauth/user/UserController.java index 4b3c916..4ecdfd3 100644 --- a/src/main/java/oauth/user/UserController.java +++ b/src/main/java/server/oauth/user/UserController.java @@ -1,9 +1,8 @@ -package oauth.user; +package server.oauth.user; -import jakarta.servlet.http.Cookie; import jakarta.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; -import oauth.exception.ZarinattaException; +import server.oauth.exception.ZarinattaException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; diff --git a/src/main/java/oauth/user/UserInputDto.java b/src/main/java/server/oauth/user/UserInputDto.java similarity index 83% rename from src/main/java/oauth/user/UserInputDto.java rename to src/main/java/server/oauth/user/UserInputDto.java index 4fa7427..7c43558 100644 --- a/src/main/java/oauth/user/UserInputDto.java +++ b/src/main/java/server/oauth/user/UserInputDto.java @@ -1,4 +1,4 @@ -package oauth.user; +package server.oauth.user; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/oauth/user/UserRepository.java b/src/main/java/server/oauth/user/UserRepository.java similarity index 95% rename from src/main/java/oauth/user/UserRepository.java rename to src/main/java/server/oauth/user/UserRepository.java index 7ca70b0..9f0859e 100644 --- a/src/main/java/oauth/user/UserRepository.java +++ b/src/main/java/server/oauth/user/UserRepository.java @@ -1,4 +1,4 @@ -package oauth.user; +package server.oauth.user; import jakarta.transaction.Transactional; import org.springframework.data.jpa.repository.JpaRepository; @@ -7,8 +7,6 @@ import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; -import java.util.Optional; - @Repository public interface UserRepository extends JpaRepository { @Transactional diff --git a/src/main/java/oauth/user/UserService.java b/src/main/java/server/oauth/user/UserService.java similarity index 88% rename from src/main/java/oauth/user/UserService.java rename to src/main/java/server/oauth/user/UserService.java index dd97a4b..56fe218 100644 --- a/src/main/java/oauth/user/UserService.java +++ b/src/main/java/server/oauth/user/UserService.java @@ -1,12 +1,11 @@ -package oauth.user; +package server.oauth.user; import lombok.RequiredArgsConstructor; -import oauth.auth.JwtService; -import oauth.exception.ZarinattaException; -import oauth.exception.ZarinattaExceptionType; +import server.oauth.auth.JwtService; +import server.oauth.exception.ZarinattaException; +import server.oauth.exception.ZarinattaExceptionType; import org.springframework.stereotype.Service; -import java.util.Optional; import java.util.UUID; @Service diff --git a/src/main/java/oauth/user/UserUpdateDto.java b/src/main/java/server/oauth/user/UserUpdateDto.java similarity index 88% rename from src/main/java/oauth/user/UserUpdateDto.java rename to src/main/java/server/oauth/user/UserUpdateDto.java index 66357c2..1f7690a 100644 --- a/src/main/java/oauth/user/UserUpdateDto.java +++ b/src/main/java/server/oauth/user/UserUpdateDto.java @@ -1,4 +1,4 @@ -package oauth.user; +package server.oauth.user; import jakarta.annotation.Nullable; import lombok.Builder; diff --git a/src/test/java/oauth/ApplicationTests.java b/src/test/java/server/ApplicationTests.java similarity index 91% rename from src/test/java/oauth/ApplicationTests.java rename to src/test/java/server/ApplicationTests.java index 33a4a49..a9e8855 100644 --- a/src/test/java/oauth/ApplicationTests.java +++ b/src/test/java/server/ApplicationTests.java @@ -1,4 +1,4 @@ -package oauth; +package server; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; From 5e6bef6751874b114e27bef046dfb17f3ba1fb8e Mon Sep 17 00:00:00 2001 From: JunHyuk Yu Date: Fri, 16 Aug 2024 00:59:44 +0900 Subject: [PATCH 2/5] =?UTF-8?q?chore:=20git=20ignore=EC=97=90=20yml=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 73f04e5..97b61d8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ build/ !**/src/test/**/build/ application.properties +*.yml ### key file push-notification-with-p-5c2ef-firebase-adminsdk-fe8i2-536a932cc1.json From 41feb2e5e1b25d8bcc6e96e0bae26347abefa71f Mon Sep 17 00:00:00 2001 From: JunHyuk Yu Date: Fri, 16 Aug 2024 01:01:23 +0900 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=ED=81=AC=EB=A1=A4=EB=A7=81=20?= =?UTF-8?q?=EC=84=9C=EB=B2=84=EC=97=90=20=EC=9E=88=EB=8D=98=20=EC=97=94?= =?UTF-8?q?=ED=8B=B0=ED=8B=B0,=20Enum=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/server/entity/BookMark.java | 52 ++++ src/main/java/server/entity/Ticket.java | 56 ++++ src/main/java/server/entity/User.java | 20 ++ src/main/java/server/enums/MainStation.java | 54 ++++ .../java/server/enums/MainStationCode.java | 54 ++++ .../java/server/enums/SeatLookingFor.java | 14 + src/main/java/server/enums/SeatState.java | 15 + src/main/java/server/enums/Station.java | 290 ++++++++++++++++++ src/main/java/server/enums/StationCode.java | 283 +++++++++++++++++ 9 files changed, 838 insertions(+) create mode 100644 src/main/java/server/entity/BookMark.java create mode 100644 src/main/java/server/entity/Ticket.java create mode 100644 src/main/java/server/entity/User.java create mode 100644 src/main/java/server/enums/MainStation.java create mode 100644 src/main/java/server/enums/MainStationCode.java create mode 100644 src/main/java/server/enums/SeatLookingFor.java create mode 100644 src/main/java/server/enums/SeatState.java create mode 100644 src/main/java/server/enums/Station.java create mode 100644 src/main/java/server/enums/StationCode.java diff --git a/src/main/java/server/entity/BookMark.java b/src/main/java/server/entity/BookMark.java new file mode 100644 index 0000000..00f955e --- /dev/null +++ b/src/main/java/server/entity/BookMark.java @@ -0,0 +1,52 @@ +package server.entity; + +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import server.enums.SeatLookingFor; + +@Entity +@Getter +@Table +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class BookMark { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "bookmark_id") + private Long id; + + @Column + private boolean wantFirstClass; + + @Column + @Enumerated(EnumType.STRING) + private SeatLookingFor wantNormalSeat; + + @Column + @Enumerated(EnumType.STRING) + private SeatLookingFor wantBabySeat; + + @Column(columnDefinition = "BOOLEAN DEFAULT FALSE", nullable = false) + private boolean wantWaitingReservation; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ticket_id") + private Ticket ticket; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id") + private User user; + + @Builder + public BookMark(boolean wantFirstClass, SeatLookingFor wantNormalSeat, SeatLookingFor wantBabySeat, boolean wantWaitingReservation, Ticket ticket, User user) { + this.wantFirstClass = wantFirstClass; + this.wantNormalSeat = wantNormalSeat; + this.wantBabySeat = wantBabySeat; + this.wantWaitingReservation = wantWaitingReservation; + this.ticket = ticket; + this.user = user; + } +} diff --git a/src/main/java/server/entity/Ticket.java b/src/main/java/server/entity/Ticket.java new file mode 100644 index 0000000..4744d42 --- /dev/null +++ b/src/main/java/server/entity/Ticket.java @@ -0,0 +1,56 @@ +package server.entity; + +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import server.enums.StationCode; + +@Entity +@Getter +@Table +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Ticket { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ticket_id") + private Long id; + + @Column(nullable = false) + private String ticketType; + + // 출발 + @Column(nullable = false) + private String departDate; + + @Column(nullable = false) + private String departTime; + + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private StationCode departStation; + + // 도착 + @Column(nullable = false) + private String arriveTime; + + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private StationCode arriveStation; + + @Column(nullable = false) + private String price; + + + @Builder + public Ticket(String ticketType, String departDate, String departTime, StationCode departStation, String arriveTime, StationCode arriveStation, String price) { + this.ticketType = ticketType; + this.departDate = departDate; + this.departTime = departTime; + this.departStation = departStation; + this.arriveTime = arriveTime; + this.arriveStation = arriveStation; + this.price = price; + } +} diff --git a/src/main/java/server/entity/User.java b/src/main/java/server/entity/User.java new file mode 100644 index 0000000..5a68550 --- /dev/null +++ b/src/main/java/server/entity/User.java @@ -0,0 +1,20 @@ +package server.entity; + +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@Table(name = "users") +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "user_id") + private Long id; + + @Column + private String phoneNumber; +} diff --git a/src/main/java/server/enums/MainStation.java b/src/main/java/server/enums/MainStation.java new file mode 100644 index 0000000..eff4e21 --- /dev/null +++ b/src/main/java/server/enums/MainStation.java @@ -0,0 +1,54 @@ +package server.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum MainStation { + GANAM("가남"), + GAPYEONG("가평"), + GANGNEUNG("강릉"), + GYEONGJU("경주"), + GONGJU("공주"), + GWANGJU_SONGJEONG("광주송정"), + GWANGJU("광주"), + GUMI("구미"), + GUPO("구포"), + GUNSAN("군산"), + DONGDAEGU("동대구"), + DAEJEON("대전"), + MASAN("마산"), + MOKPO("목포"), + BUSAN("부산"), + SEO_UL("서울"), + SEO_DAEGU("서대구"), + SUWON("수원"), + SUNCHEON("순천"), + SINHAE_UNDAE("신해운대"), + ASAN("아산"), + ANYANG("안양"), + ANDONG("안동"), + YEOSU_EXPO("여수EXPO"), + YEONGDEUNGPO("영등포"), + YEONGJU("영주"), + IKSAN("익산"), + INCHEON_GONGHANG_T1("인천공항T1"), + INCHEON_GONGHANG_T2("인천공항T2"), + JEONJU("전주"), + CHEONAN("천안"), + CHEONAN_ASAN("천안아산"), + CHEONGLYANG_RI("청량리"), + CHUNCHEON("춘천"), + TAEBAEK("태백"), + PANGYO_GYEONGGI("판교(경기)"), + PYEONGCHANG("평창"), + PYEONGTAEK("평택"), + POHANG("포항"), + HADONG("하동"), + HAMAN("함안"), + HONGSEONG("홍성"); + + + private final String name; +} diff --git a/src/main/java/server/enums/MainStationCode.java b/src/main/java/server/enums/MainStationCode.java new file mode 100644 index 0000000..13f6549 --- /dev/null +++ b/src/main/java/server/enums/MainStationCode.java @@ -0,0 +1,54 @@ +package server.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum MainStationCode { + GANAM("NAT280090", "가남"), + GAPYEONG("NAT140576", "가평"), + GANGNEUNG("NAT601936", "강릉"), + GYEONGJU("NATH13421", "경주"), + GONGJU("NATH20438", "공주"), + GWANGJU_SONGJEONG("NAT031857", "광주송정"), + GWANGJU("NAT883012", "광주"), + GUMI("NAT012775", "구미"), + GUPO("NAT014281", "구포"), + GUNSAN("NAT081388", "군산"), + DONGDAEGU("NAT013271", "동대구"), + DAEJEON("NAT011668", "대전"), + MASAN("NAT880345", "마산"), + MOKPO("NAT032563", "목포"), + BUSAN("NAT014445", "부산"), + SEO_UL("NAT010000", "서울"), + SEO_DAEGU("NAT013189", "서대구"), + SUWON("NAT010415", "수원"), + SUNCHEON("NAT041595", "순천"), + SINHAE_UNDAE("NAT750189", "신해운대"), + ASAN("NAT080045", "아산"), + ANYANG("NAT010239", "안양"), + ANDONG("NAT022558", "안동"), + YEOSU_EXPO("NAT041993", "여수EXPO"), + YEONGDEUNGPO("NAT010091", "영등포"), + YEONGJU("NAT022188", "영주"), + IKSAN("NAT030879", "익산"), + INCHEON_GONGHANG_T1("NATC10580", "인천공항T1"), + INCHEON_GONGHANG_T2("NATC30058", "인천공항T2"), + JEONJU("NAT040257", "전주"), + CHEONAN("NAT010971", "천안"), + CHEONAN_ASAN("NATH10960", "천안아산"), + CHEONGLYANG_RI("NAT130126", "청량리"), + CHUNCHEON("NAT140873", "춘천"), + TAEBAEK("NAT650978", "태백"), + PANGYO_GYEONGGI("NAT081240", "판교"), + PYEONGCHANG("NATN10625", "평창"), + PYEONGTAEK("NAT010754", "평택"), + POHANG("NAT8B0351", "포항"), + HADONG("NAT881460", "하동"), + HAMAN("NAT880520", "함안"), + HONGSEONG("NAT080622", "홍성"); + + private final String code; + private final String name; +} diff --git a/src/main/java/server/enums/SeatLookingFor.java b/src/main/java/server/enums/SeatLookingFor.java new file mode 100644 index 0000000..ff2aa78 --- /dev/null +++ b/src/main/java/server/enums/SeatLookingFor.java @@ -0,0 +1,14 @@ +package server.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum SeatLookingFor { + SEAT("좌석"), + STANDING_SEAT("입석 + 좌석"), + NOTFOUND("필요 없음"); + + private final String text; +} diff --git a/src/main/java/server/enums/SeatState.java b/src/main/java/server/enums/SeatState.java new file mode 100644 index 0000000..3b38ab5 --- /dev/null +++ b/src/main/java/server/enums/SeatState.java @@ -0,0 +1,15 @@ +package server.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum SeatState { + 신청하기("예약 대기 신청 하기"), + 예약하기("좌석 예약 하기"), + 입좌석묶음예약("입석 + 좌석 묶음 예약"), + 유아동반객실("유아석"); + + private final String text; +} diff --git a/src/main/java/server/enums/Station.java b/src/main/java/server/enums/Station.java new file mode 100644 index 0000000..abef5ab --- /dev/null +++ b/src/main/java/server/enums/Station.java @@ -0,0 +1,290 @@ +package server.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum Station { + // 가 + GANAM("가남"), + GAPYEONG("가평"), + GAKGYE("각계"), + GAMGOK_JANGHOWON("감곡장호원"), + GANGGYEONG("강경"), + GANGGU("강구"), + GANGNEUNG("강릉"), + GANGCHON("강촌"), + GAEPO("개포"), + GEONCHEON("건천"), + GYEONGSAN("경산"), + GYEONGJU("경주"), + GYERYONG("계룡"), + GOHAN("고한"), + GOKSEONG("곡성"), + GONGJU("공주"), + GWANGMYEONG("광명"), + GWANGYANG("광양"), + GWANGJU("광주"), + GWANGJU_SONGJEONG("광주송정"), + GWANGCHEON("광천"), + GURYEGU("구례구"), + GUMI("구미"), + GUPO("구포"), + GUNBUK("군북"), + GUNSAN("군산"), + GEUKRAKGANG("극락강"), + GIJANG("기장"), + GIMJE("김제"), + GIMCHEON("김천"), + GIMCHEON_GUMI("김천구미"), + + + // 나 + NAJEON("나전"), + NAJU("나주"), + NAMSEONGHYUN("남성현"), + NAMWON("남원"), + NAMCHANG("남창"), + NAMCHUNCHEON("남춘천"), + NONGSAN("논산"), + NEUNGJU("능주"), + + // 다 + DASI("다시"), + DANYANG("단양"), + DAEGU("대구"), + DEAYA("대야"), + DAEJEON("대전"), + DAECHEON("대천"), + DEOKSO("덕소"), + DEOKHA("덕하"), + DOGYE("도계"), + DOGO_ONCHEON("도고온천"), + DORASAN("도라산"), + DONGDAEGU("동대구"), + DONGBAEKSAN("동백산"), + DONGTAN("동탄"), + DONGHAE("동해"), + DONGHWA("동화"), + DONNAE("둔내"), + DEUKRANG("득량"), + + // 마 + MASAN("마산"), + MASEOK("마석"), + MANJONG("만종"), + MAEGOK("매곡"), + MYEONGBONG("명봉"), + MOKPO("목포"), + MONGTAN("몽탄"), + MUAN("무안"), + MOKHO("묵호"), + MUNSAN("문산"), + MULGEUM("물금"), + MINDEUNGSAN("민둥산"), + MIRYANG("밀양"), + + // 반 + BANGO("반곡"), + BANSEONG("반성"), + BAEKYANGLI("백양리"), + BAEKYANGSA("백양사"), + BEOLGYO("벌교"), + BEOLEOGOK("벌어곡"), + BOSEONG("보성"), + BONGYANG("봉양"), + BONGHWA("봉화"), + BUGANG("부강"), + BUBAL("부발"), + BUSAN("부산"), + BUJEON("부전"), + BUGYEONGCHEON("북영천"), + BUKULSAN("북울산"), + BUKCHEON("북천"), + BUNCHEON("분천"), + BULGUKSA("불국사"), + BIDONG("비동"), + + // 사 + SAREUNG("사릉"), + SABOK("사북"), + SASANG("사상"), + SAMRANGJIN("삼랑진"), + SAMRE("삼례"), + SAMSAN("삼산"), + SAMTAN("삼탄"), + SAPGYO("삽교"), + SANGDONG("상동"), + SANGBONG("상봉"), + SANGJU("상주"), + SEO_GYEONGJU("서경주"), + SEO_GWANGJU("서광주"), + SEO_DAEGU("서대구"), + SEO_DAEJEON("서대전"), + SEO_UL("서울"), + SEOWONJU("서원주"), + SEOJEONGRI("서정리"), + SEOCHUN("서천"), + SEOKBUL("석불"), + SEOKPO("석포"), + SEONPYEONG("선평"), + SEONGHWAN("성환"), + SENTEM("센텀"), + SUSHE("수서"), + SUWON("수원"), + SUNCHEON("순천"), + SEUNGBU("승부"), + SINGI("신기"), + SINNONG("신녕"), + SINDONG("신동"), + SINRAE_ON("신례원"), + SINRIM("신림"), + SINTANJIN("신탄진"), + SINTAE_IN("신태인"), + SINHAE_UNDAE("신해운대"), + SIMCHEON("심천"), + SSANGRYONG("쌍룡"), + + // 아 + ASAN("아산"), + AOURAJI("아우라지"), + AHWA("아화"), + ANGANG("안강"), + ANDONG("안동"), + ANYANG("안양"), + ANGSEONG_ONCHEON("양성온천"), + YAKMOK("약목"), + YANGDONG("양동"), + YANGWON("양원"), + YANGPYUNG("양평"), + YEOSU_EXPO("여수EXPO"), + YEOJEON("여전"), + YEONSAN("연산"), + YEONGDEOK("영덕"), + YEONGDONG("영동"), + YEONGDEUNGPO("영등포"), + YEONGWOL("영월"), + YEONGJU("영주"), + YEONGCHEON("영천"), + YEDANG("예당"), + YEMI("예미"), + YESAN("예산"), + YECHEON("예천"), + O_GEUNJANG("오근장"), + OSAN("오산"), + OSUNG("오송"), + OSU("오수"), + OKSAN("옥산"), + OKSU("옥수"), + OKCHEON("옥천"), + O_GO_ONCHEON("온양온천"), + WANSAN("완산"), + WANGSIMNI("왕십리"), + WAEPYEONG("왜관"), + YONGGUNG("용궁"), + YONGMUN("용문"), + YONGSAN("용산"), + UNCHEON("운천"), + ULSAN_TONGDOSA("울산(통도사)"), + UNGCHEON("웅천"), + WONDEONG("원동"), + WONJU("원주"), + WOLPO("월포"), + EUMSEONG("음성"), + UISUNG("의성"), + IYANG("이양"), + IWON("이원"), + IKSAN("익산"), + INCHEON_GONGHANG_T1("인천공항T1"), + INCHEON_GONGHANG_T2("인천공항T2"), + ILRO("일로"), + ILSIN("일신"), + IMGI("임기"), + IMSANRI("임성리"), + IMSIL("임실"), + IMJINGANG("임진강"), + + // 장 + JANGSA("장사"), + JANGSEONG("장성"), + JANGHANG("장항"), + JEON_UI("전의"), + JEONJU("전주"), + JEMCHON("점촌"), + JEONGDONGJIN("정동진"), + JEONGSEON("정선"), + JEONGUP("정읍"), + JE_CHUN("제천"), + JOSUNG("조성"), + JOSIWON("조치원"), + JWA_CHON("좌천"), + JU_DEUK("주덕"), + JUNG_LI("중리"), + JEUNG_PYUNG("증평"), + JITAN("지탄"), + JI_PYUNG("지평"), + JIN_LAE("진례"), + JIN_BU("진부(오대산)"), + JIN_SANG("진상"), + JIN_YEONG("진영"), + JIN_JU("진주"), + + // 창 + CHANGWON("창원"), + CHANGWON_JOONGANG("창원중앙"), + CHEONAN("천안"), + CHEONAN_ASAN("천안아산"), + CHEOL_AM("철암"), + CHEONDO("청도"), + CHEONGLYANG_RI("청량리"), + CHEONGRI("청리"), + CHEONGSO("청소"), + CHEONGJU("청주"), + CHEONGJU_GONGHANG("청주공항"), + CHEONGPYUNG("청평"), + CHUPUNG_REUNG("추풍령"), + CHUNYANG("춘양"), + CHUNCHEON("춘천"), + CUNGJU("충주"), + + // 탑 + TAPRI("탑리"), + TAEBAEK("태백"), + TAEHWA_GANG("태화강"), + TOEGE_WON("퇴계원"), + + //파 + PANGYO_GYEONGGI("판교(경기)"), + PANGYO_CHUNGNAM("판교(충남)"), + PYEONGNAE_HOPEONG("평내호평"), + PYEONGCHANG("평창"), + PYEONGTAEK("평택"), + PYEONGTAEK_JIJAE("평택지제"), + POHANG("포항"), + PUNGGI("풍기"), + + //하 + HADONG("하동"), + HAYANG("하양"), + HANRIMJEONG("한림정"), + HAMAN("함안"), + HAMYEOL("함열"), + HAMCHANG("함창"), + HAMPYEONG("함평"), + HAENGSIN("행신"), + HYONDDONG("현동"), + HOGYE("호계"), + HONGSEONG("홍성"), + HWAMYEONG("화명"), + HWABON("화본"), + HWAJUN("화순"), + HWANGGAN("황간"), + HWANGSEONG("횡성"), + HWANJEON("황전"), + HYOJEON("효전"), + HWIBANGSA("희방사"); + + + private final String name; +} diff --git a/src/main/java/server/enums/StationCode.java b/src/main/java/server/enums/StationCode.java new file mode 100644 index 0000000..9c5984e --- /dev/null +++ b/src/main/java/server/enums/StationCode.java @@ -0,0 +1,283 @@ +package server.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum StationCode { + // 가 + 가남("NAT280090"), + 가평("NAT140576"), + 각계("NAT012054"), + 감곡장호원("NAT280212"), + 강경("NAT030607"), + 강구("NAT8B0671"), + 강릉("NAT601936"), + 강촌("NAT140701"), + 개포("NAT300733"), + 경산("NAT013395"), + 계룡("NAT030254"), + 고한("NAT650828"), + 곡성("NAT041072"), + 공주("NATH20438"), + 광명("NATH10219"), + 광양("NAT881708"), + 광주("NAT883012"), + 광주송정("NAT031857"), + 광천("NAT080749"), + 구례구("NAT041285"), + 구미("NAT012775"), + 구포("NAT014281"), + 군북("NAT880520"), + 군산("NAT081388"), + 극락강("NAT883086"), + 기장("NAT750329"), + 김제("NAT031056"), + 김천("NAT012546"), + 김천구미("NATH12383"), + + // 나 + 나전("NAT610326"), + 나주("NAT031998"), + 남성현("NAT013542"), + 남원("NAT040868"), + 남창("NAT750560"), + 남춘천("NAT140840"), + 논산("NAT030508"), + 능주("NAT882666"), + + // 다 + 다시("NAT032099"), + 단양("NAT021784"), + 대구("NAT013239"), + 대야("NAT320131"), + 대전("NAT011668"), + 대천("NAT080952"), + 덕소("NAT020178"), + 덕하("NAT750653"), + 도계("NAT601122"), + 도고온천("NAT080309"), + 도라산("NAT110557"), + 동대구("NAT013271"), + 동백산("NAT651053"), + 동탄("NATH30326"), + 동해("NAT601485"), + 동화("NAT020986"), + 둔내("NATN10428"), + 득량("NAT882237"), + + // 마 + 마산("NAT880345"), + 마석("NAT140277"), + 만종("NAT021033"), + 매곡("NAT020803"), + 명봉("NAT882416"), + 목포("NAT032563"), + 몽탄("NAT032313"), + 무안("NAT032273"), + 묵호("NAT601545"), + 문산("NAT110460"), + 물금("NAT014150"), + 민둥산("NAT650722"), + 밀양("NAT013841"), + + // 바 + 반곡("NAT021175"), + 반성("NAT880766"), + 백양리("NAT140681"), + 백양사("NAT031486"), + 벌교("NAT882034"), + 봉양("NAT021478"), + 봉화("NAT600147"), + 부강("NAT011403"), + 부발("NAT250428"), + 부산("NAT014445"), + 부전("NAT750046"), + 북영천("NAT023424"), + 북울산("NAT750781"), + 북천("NAT881269"), + 분천("NAT600593"), + 불국사("NAT013067"), + + // 사 + 사릉("NAT140133"), + 사북("NAT650782"), + 사상("NAT014331"), + 삼랑진("NAT013967"), + 삼례("NAT040133"), + 삼산("NAT020884"), + 삼탄("NAT051006"), + 삽교("NAT080492"), + 상동("NAT013747"), + 상봉("NAT020040"), + 상주("NAT300360"), + 서경주("NAT023821"), + 서광주("NAT882936"), + 서대구("NAT013189"), + 서대전("NAT030057"), + 서울("NAT010000"), + 서원주("NAT020864"), + 서정리("NAT011079"), + 서천("NAT081343"), + 석불("NAT020717"), + 석포("NAT600768"), + 선평("NAT610137"), + 성환("NAT010848"), + 센텀("NAT750161"), + 수서("NATH30000"), + 수원("NAT010415"), + 순천("NAT041595"), + 승부("NAT600692"), + 신기("NAT601275"), + 신녕("NAT023279"), + 신동("NAT013067"), + 신례원("NAT080353"), + 신림("NAT021357"), + 신탄진("NAT011524"), + 신태인("NAT031179"), + 신창원("NAT810048"), + 신해운대("NAT750189"), + 심천("NAT012016"), + 쌍룡("NAT650177"), + + // 아 + 아산("NAT080045"), + 아우라지("NAT610387"), + 아화("NAT023601"), + 안강("NAT751296"), + 안동("NAT022558"), + 안양("NAT010239"), + 앙성온천("NAT280358"), + 약목("NAT012903"), + 양동("NAT020845"), + 양원("NAT600655"), + 양평("NAT020524"), + 여수EXPO("NAT041993"), + 여전("NAT032422"), + 연산("NAT030396"), + 영덕("NAT8B0737"), + 영동("NAT012124"), + 영등포("NAT010091"), + 영월("NAT650341"), + 영주("NAT022188"), + 영천("NAT023449"), + 예당("NAT882194"), + 예미("NAT650515"), + 예산("NAT080402"), + 예천("NAT300850"), + 오근장("NAT050215"), + 오산("NAT010570"), + 오송("NAT050044"), + 오수("NAT040667"), + 옥산("NAT300200"), + 옥수("NAT130070"), + 옥천("NAT011833"), + 온양온천("NAT080147"), + 완사("NAT881168"), + 왕십리("NAT130104"), + 왜관("NAT012968"), + 용궁("NAT300669"), + 용문("NAT020641"), + 용산("NAT010032"), + 운천("NAT110497"), + 울산통도사("NATH13717"), + 신웅천("NAT081099"), // # 웅천 -> 신웅천 + 원동("NAT014058"), + 원주("NAT020947"), + 월포("NAT8B0504"), + 음성("NAT050596"), + 의성("NAT022844"), + 이양("NAT882544"), + 이원("NAT011916"), + 익산("NAT030879"), + 인천공항T1("NATC10580"), + 인천공항T2("NATC30058"), + 일로("NAT032422"), + 일신("NAT020760"), + 임기("NAT600476"), + 임성리("NAT032489"), + 임실("NAT040536"), + 임진강("NAT110520"), + + // 장 + 장사("NAT8B0595"), + 장성("NAT031638"), + 장항("NAT081318"), + 전의("NAT011154"), + 전주("NAT040257"), + 점촌("NAT300600"), + 정동진("NAT601774"), + 정선("NAT610226"), + 정읍("NAT031314"), + 제천("NAT021549"), + 조성("NAT882141"), + 조치원("NAT011298"), + 좌천("NAT750412"), + 주덕("NAT050719"), + 중리("NAT880408"), + 증평("NAT050366"), + 지탄("NAT011972"), + 지평("NAT020677"), + 진례("NAT880179"), + 진부("NATN10787"), //@(오대산) 추가 + 진상("NAT881538"), + 진영("NAT880177"), + 진주("NAT881014"), + + // 창 + 창원("NAT880310"), + 창원중앙("NAT880281"), + 천안("NAT010971"), + 천안아산("NATH10960"), + 철암("NAT600870"), + 청도("NAT013629"), + 청량리("NAT130126"), + 청리("NAT300271"), + 청소("NAT080827"), + 청주("NAT050114"), + 청주공항("NAT050244"), + 청평("NAT140436"), + 추풍령("NAT012355"), + 춘양("NAT600379"), + 춘천("NAT140873"), + 충주("NAT050827"), + + // 탑 + 탑리("NAT022961"), + 태백("NAT650978"), + 태화강("NAT750726"), + 퇴계원("NAT140098"), + + // 파 + 신판교("NAT250007"), //# 판교경기 -> 신판교 + 판교("NAT081240"), // # 판교충남->판교 + 평내호평("NAT140214"), + 평창("NATN10625"), + 평택("NAT010754"), + 지제("NATH30536"), // # 평택지제 -> 지제 + 포항("NAT8B0351"), + 풍기("NAT022053"), + + // 하 + 하동("NAT881460"), + 하양("NAT830200"), + 한림정("NAT880099"), + 함안("NAT880608"), + 함열("NAT030718"), + 함창("NAT300558"), + 함평("NAT032212"), + 행신("NAT110147"), + 현동("NAT600527"), + 호계("NAT012903"), + 홍성("NAT080622"), + 화명("NAT014244"), + 화본("NAT023127"), + 화순("NAT882755"), + 황간("NAT012270"), + 횡성("NATN10230"), + 희방사("NAT300733"); + + private final String code; + +} From e729dfe4be276b4a8b29f2e56b361519ef026476 Mon Sep 17 00:00:00 2001 From: JunHyuk Yu Date: Fri, 16 Aug 2024 01:18:25 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20User=20=EC=97=94=ED=8B=B0=ED=8B=B0?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EB=8D=94=EB=AF=B8=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/server/entity/BookMark.java | 2 +- src/main/java/server/entity/User.java | 32 ++- src/main/java/server/oauth/user/User.java | 36 --- .../server/oauth/user/UserRepository.java | 1 + .../java/server/oauth/user/UserService.java | 1 + src/main/resources/data.sql | 213 ++++++++++++++++++ 6 files changed, 239 insertions(+), 46 deletions(-) delete mode 100644 src/main/java/server/oauth/user/User.java create mode 100644 src/main/resources/data.sql diff --git a/src/main/java/server/entity/BookMark.java b/src/main/java/server/entity/BookMark.java index 00f955e..7a3c5e6 100644 --- a/src/main/java/server/entity/BookMark.java +++ b/src/main/java/server/entity/BookMark.java @@ -37,7 +37,7 @@ public class BookMark { private Ticket ticket; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "user_id") + @JoinColumn(name = "USER_ID") private User user; @Builder diff --git a/src/main/java/server/entity/User.java b/src/main/java/server/entity/User.java index 5a68550..02b53ab 100644 --- a/src/main/java/server/entity/User.java +++ b/src/main/java/server/entity/User.java @@ -1,20 +1,34 @@ package server.entity; import jakarta.persistence.*; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -@Entity +import jakarta.annotation.Nullable; +import lombok.*; + +@Entity(name="USERS") +@Table(name="USERS") @Getter -@Table(name = "users") +@Builder @NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor public class User { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "user_id") - private Long id; + @Column(name="USER_ID") + private String id; + + @Column(name="USER_EMAIL") + private String userEmail; + + @Column(name="USER_NICK") + private String userNick; + + @Column(name="USER_PHONE") + @Nullable + private String userPhoneNumber; - @Column - private String phoneNumber; + @Column(name="USER_DEVICE_TOKEN") + @Nullable + private String userDeviceToken; } diff --git a/src/main/java/server/oauth/user/User.java b/src/main/java/server/oauth/user/User.java deleted file mode 100644 index fbfa9ac..0000000 --- a/src/main/java/server/oauth/user/User.java +++ /dev/null @@ -1,36 +0,0 @@ -package server.oauth.user; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.Id; -import jakarta.persistence.Table; - -import jakarta.annotation.Nullable; -import lombok.*; - -@Entity(name="USERS") -@Table(name="USERS") -@Getter -@Builder -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -public class User { - - @Id - @Column(name="USER_ID") - private String id; - - @Column(name="USER_EMAIL") - private String userEmail; - - @Column(name="USER_NICK") - private String userNick; - - @Column(name="USER_PHONE") - @Nullable - private String userPhoneNumber; - - @Column(name="USER_DEVICE_TOKEN") - @Nullable - private String userDeviceToken; -} diff --git a/src/main/java/server/oauth/user/UserRepository.java b/src/main/java/server/oauth/user/UserRepository.java index 9f0859e..99e3253 100644 --- a/src/main/java/server/oauth/user/UserRepository.java +++ b/src/main/java/server/oauth/user/UserRepository.java @@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; +import server.entity.User; @Repository public interface UserRepository extends JpaRepository { diff --git a/src/main/java/server/oauth/user/UserService.java b/src/main/java/server/oauth/user/UserService.java index 56fe218..02c24b0 100644 --- a/src/main/java/server/oauth/user/UserService.java +++ b/src/main/java/server/oauth/user/UserService.java @@ -1,6 +1,7 @@ package server.oauth.user; import lombok.RequiredArgsConstructor; +import server.entity.User; import server.oauth.auth.JwtService; import server.oauth.exception.ZarinattaException; import server.oauth.exception.ZarinattaExceptionType; diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 0000000..c1d0126 --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,213 @@ +-- User 데이터 삽입 +INSERT INTO USERS (USER_EMAIL, USER_NICK, USER_PHONE, USER_DEVICE_TOKEN) VALUES + ('user1@example.com', 'UserOne', '010-1234-5678', 'device_token_1'), + ('user2@example.com', 'UserTwo', '010-2345-6789', 'device_token_2'), + ('user3@example.com', 'UserThree', '010-3456-7890', 'device_token_3'); + + +-- Ticket 데이터 삽입 +INSERT INTO ticket (ticket_id, ticket_type, depart_date, depart_time, depart_station, arrive_time, arrive_station, price) VALUES + (8080, 'KTX-이음 816', '20240807', '20240807152400', '강릉', '20240807154600', '평창', '8400원'), + (8160, 'SRT 681', '20240807', '20240807112900', '공주', '20240807120600', '전주', '8800원'), + (8240, '무궁화호 1974', '20240807', '20240807154100', '광주송정', '20240807175800', '순천', '7700원'), + (8320, 'KTX-산천(B-type) 438', '20240807', '20240807212000', '광주송정', '20240807224700', '천안아산', '33800원'), + (8400, '무궁화호 1424', '20240807', '20240807145900', '광주', '20240807182600', '천안', '17000원'), + (8480, '무궁화호 1210', '20240807', '20240807120600', '구미', '20240807132300', '대전', '7200원'), + (8560, 'ITX-마음 1108', '20240807', '20240807195400', '구미', '20240807225300', '서울', '0원'), + (8640, 'ITX-마음 1106', '20240807', '20240807165900', '구미', '20240807185200', '천안', '0원'), + (8720, 'ITX-마음 9906', '20240807', '20240807152000', '구포', '20240807192100', '수원', '0원'), + (8800, 'KTX 108', '20240807', '20240807154000', '구포', '20240807163800', '동대구', '10300원'), + (8880, 'ITX-새마을 1008', '20240807', '20240807132700', '구포', '20240807170600', '천안', '31700원'), + (8960, '새마을호 1058', '20240807', '20240807142600', '군산', '20240807162600', '아산', '12200원'), + (9040, '무궁화호 1560', '20240807', '20240807131600', '군산', '20240807154500', '평택', '9900원'), + (9120, 'ITX-새마을 1021', '20240807', '20240807103300', '동대구', '20240807113000', '구포', '9500원'), + (9200, 'KTX 126', '20240807', '20240807184300', '동대구', '20240807203400', '수원', '31300원'), + (9280, 'SRT 345', '20240807', '20240807171600', '동대구', '20240807175700', '부산', '15600원'), + (9360, 'KTX 124', '20240807', '20240807140600', '동대구', '20240807162100', '영등포', '34200원'), + (9440, 'SRT 318', '20240807', '20240807094900', '동대구', '20240807102900', '대전', '17600원'), + (9520, '무궁화호 1356', '20240807', '20240807182400', '동대구', '20240807202600', '대전', '10400원'), + (9600, 'KTX-산천(A-type) 240', '20240807', '20240807114500', '동대구', '20240807133600', '서울', '43500원'), + (9680, 'KTX 70', '20240807', '20240807223000', '동대구', '20240808002100', '서울', '43500원'), + (9760, 'ITX-마음 9907', '20240807', '20240807135600', '대전', '20240807150200', '구미', '0원'), + (9840, 'KTX-산천(A-type) 196', '20240807', '20240807175200', '동대구', '20240807190800', '천안아산', '29300원'), + (9920, 'KTX 124', '20240807', '20240807144800', '대전', '20240807155600', '수원', '12900원'), + (10000, 'KTX 33', '20240807', '20240807142900', '대전', '20240807155800', '부산', '36200원'), + (10080, '무궁화호 1210', '20240807', '20240807132500', '대전', '20240807151700', '영등포', '10200원'), + (10160, 'ITX-새마을 1021', '20240807', '20240807085100', '대전', '20240807103100', '동대구', '15400원'), + (10240, 'ITX-새마을 1004', '20240807', '20240807113100', '대전', '20240807132200', '서울', '16000원'), + (10320, 'SRT 393', '20240807', '20240807173400', '대전', '20240807182000', '동대구', '17600원'), + (10400, 'KTX 66', '20240807', '20240807223500', '대전', '20240807234400', '서울', '23700원'), + (10480, 'KTX 8', '20240807', '20240807075100', '대전', '20240807082000', '천안아산', '9600원'), + (10560, '무궁화호 1945', '20240807', '20240807202500', '마산', '20240807220400', '순천', '7400원'), + (10640, 'ITX-마음 1162', '20240807', '20240807110600', '목포', '20240807150400', '수원', '0원'), + (10720, 'KTX-산천(A-type) 4042', '20240807', '20240807151900', '목포', '20240807162700', '익산', '21100원'), + (10800, 'ITX-새마을 1004', '20240807', '20240807082000', '부산', '20240807124800', '수원', '38600원'), + (10880, 'KTX 124', '20240807', '20240807131800', '부산', '20240807162100', '영등포', '48000원'), + (10960, 'KTX 58', '20240807', '20240807191300', '부산', '20240807213500', '서울', '59800원'), + (11040, 'ITX-마음 1102', '20240807', '20240807104000', '부산', '20240807114700', '동대구', '0원'), + (11120, 'KTX 66', '20240807', '20240807210000', '부산', '20240807214600', '동대구', '17100원'), + (11200, 'KTX 94', '20240807', '20240807162900', '부산', '20240807180200', '대전', '36200원'), + (11280, 'KTX 30', '20240807', '20240807120000', '부산', '20240807140600', '천안아산', '46500원'), + (11360, '무궁화호 1205', '20240807', '20240807071600', '서울', '20240807103900', '구미', '17900원'), + (11440, '무궁화호 1317', '20240807', '20240807193100', '서울', '20240807195600', '안양', '2600원'), + (11520, 'KTX 47', '20240807', '20240807162800', '서울', '20240807181000', '동대구', '43500원'), + (11600, 'KTX 121', '20240807', '20240807081200', '서울', '20240807113200', '부산', '48800원'), + (11680, 'KTX-산천(A-type) 75', '20240807', '20240807060300', '서울', '20240807071200', '대전', '23700원'), + (11760, '무궁화호 1215', '20240807', '20240807172800', '서울', '20240807193500', '대전', '10800원'), + (11840, 'KTX-이음 843', '20240807', '20240807110100', '서울', '20240807112000', '청량리', '8400원'), + (11920, 'ITX-마음 1105', '20240807', '20240807084900', '서울', '20240807095300', '천안', '0원'), + (12000, 'KTX 5', '20240807', '20240807055800', '서울', '20240807063800', '천안아산', '14100원'), + (12080, 'KTX 42', '20240807', '20240807154500', '서대구', '20240807163000', '대전', '18100원'), + (12160, '무궁화호 1205', '20240807', '20240807075200', '수원', '20240807111800', '동대구', '18500원'), + (12240, 'KTX 4007', '20240807', '20240807155600', '수원', '20240807170400', '대전', '12900원'), + (12320, '무궁화호 1282', '20240807', '20240807113800', '수원', '20240807121100', '서울', '2700원'), + (12400, '무궁화호 1559', '20240807', '20240807132600', '수원', '20240807163600', '익산', '13400원'), + (12480, '무궁화호 1422', '20240807', '20240807161900', '수원', '20240807164000', '영등포', '2600원'), + (12560, 'ITX-마음 9941', '20240807', '20240807103100', '수원', '20240807110200', '천안', '0원'), + (12640, '새마을호 1055', '20240807', '20240807141600', '수원', '20240807143500', '평택', '4800원'), + (12720, 'KTX-산천(A-type) 518', '20240807', '20240807165700', '순천', '20240807185200', '천안아산', '32000원'), + (12800, 'KTX-산천(A-type) 506', '20240807', '20240807090400', '순천', '20240807100100', '전주', '12400원'), + (12880, '새마을호 1060', '20240807', '20240807212600', '아산', '20240807220700', '수원', '5700원'), + (12960, '무궁화호 1316', '20240807', '20240807082000', '안양', '20240807084700', '서울', '2600원'), + (13040, 'ITX-새마을 1092', '20240807', '20240807053900', '안동', '20240807055900', '영주', '0원'), + (13120, 'KTX-산천(B-type) 542', '20240807', '20240807074800', '여수EXPO', '20240807080800', '순천', '8400원'), + (13200, 'ITX-마음 1182', '20240807', '20240807110800', '여수EXPO', '20240807123300', '전주', '0원'), + (13280, '무궁화호 1215', '20240807', '20240807174200', '영등포', '20240807230500', '구포', '27000원'), + (13360, '무궁화호 1211', '20240807', '20240807141800', '영등포', '20240807180400', '동대구', '20600원'), + (13440, '무궁화호 1315', '20240807', '20240807185000', '영등포', '20240807190300', '안양', '2600원'), + (13520, '새마을호 1051', '20240807', '20240807092700', '영등포', '20240807094900', '수원', '4800원'), + (13600, 'ITX-마음 4141', '20240807', '20240807081700', '영등포', '20240807110400', '익산', '0원'), + (13680, '무궁화호 1561', '20240807', '20240807143700', '영등포', '20240807152000', '평택', '4300원'), + (13760, 'ITX-마음 1183', '20240807', '20240807172700', '영등포', '20240807181800', '천안', '0원'), + (13840, 'KTX-산천(B-type) 508', '20240807', '20240807120000', '익산', '20240807121600', '공주', '8400원'), + (13920, 'KTX-산천(A-type) 435', '20240807', '20240807215400', '익산', '20240807223000', '광주송정', '14200원'), + (14000, 'ITX-마음 1182', '20240807', '20240807125600', '익산', '20240807150400', '수원', '0원'), + (14080, 'ITX-마음 1183', '20240807', '20240807200400', '익산', '20240807214300', '여수EXPO', '0원'), + (14160, '새마을호 1060', '20240807', '20240807191200', '익산', '20240807213200', '천안', '14700원'), + (14240, '무궁화호 1560', '20240807', '20240807125300', '익산', '20240807142800', '홍성', '6300원'), + (14320, 'KTX공항버스 8080', '20240807', '20240807211000', '인천공항T1', '20240807213000', '인천공항T2', '8000원'), + (14400, 'KTX-산천(B-type) 523', '20240807', '20240807231500', '전주', '20240808001100', '순천', '12400원'), + (14480, 'KTX-산천(A-type) 544', '20240807', '20240807204800', '전주', '20240807210500', '익산', '8400원'), + (14560, 'ITX-새마을 1013', '20240807', '20240807211900', '천안', '20240808004400', '구포', '31700원'), + (14640, '무궁화호 1319', '20240807', '20240807213000', '천안', '20240807222300', '대전', '4500원'), + (14720, '무궁화호 1503', '20240807', '20240807104500', '천안', '20240807151300', '여수EXPO', '21600원'), + (14800, 'ITX-새마을 1012', '20240807', '20240807221800', '천안', '20240807224500', '수원', '5300원'), + (14880, 'KTX-산천(A-type) 427', '20240807', '20240807172300', '천안아산', '20240807174600', '공주', '11400원'), + (14960, 'KTX 413', '20240807', '20240807111500', '천안아산', '20240807123200', '광주송정', '33800원'), + (15040, '무궁화호 1568', '20240807', '20240807224400', '천안', '20240807230000', '평택', '2600원'), + (15120, 'SRT 9371', '20240807', '20240807210800', '천안아산', '20240807222500', '동대구', '26400원'), + (15200, 'KTX 111', '20240807', '20240807221900', '천안아산', '20240807224200', '대전', '9600원'), + (15280, 'KTX-산천(B-type) 515', '20240807', '20240807172300', '천안아산', '20240807193000', '순천', '32000원'), + (15360, 'KTX 216', '20240807', '20240807191600', '천안아산', '20240807200000', '서울', '14100원'), + (15440, 'KTX-이음 814', '20240807', '20240807141000', '청량리', '20240807142900', '서울', '8400원'), + (15520, 'ITX-청춘 2010', '20240807', '20240807092100', '춘천', '20240807093900', '가평', '3000원'), + (15600, '무궁화호 1423', '20240807', '20240807171300', '평택', '20240807205700', '광주', '18400원'), + (15680, 'ITX-새마을 1011', '20240807', '20240807163100', '평택', '20240807201600', '구포', '33800원'), + (15760, '무궁화호 1503', '20240807', '20240807103100', '평택', '20240807151300', '여수EXPO', '23000원'), + (15840, 'ITX-마음 1184', '20240807', '20240807193700', '평택', '20240807195500', '수원', '0원'), + (15920, '새마을호 1051', '20240807', '20240807101100', '평택', '20240807125100', '익산', '16800원'), + (16000, 'ITX-새마을 1083', '20240807', '20240807172800', '평택', '20240807174000', '천안', '4800원'); + + + +INSERT INTO BOOK_MARK (bookmark_id, want_first_class, want_normal_seat, want_baby_seat, want_waiting_reservation, ticket_id, USER_ID) VALUES + (1, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 8080, 1), + (2, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 8160, 1), + (3, TRUE, 'NOTFOUND', 'SEAT', FALSE, 8240, 1), + (4, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 8320, 1), + (5, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 8400, 1), + (6, TRUE, 'NOTFOUND', 'SEAT', FALSE, 8480, 1), + (7, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 8560, 1), + (8, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 8640, 1), + (9, TRUE, 'NOTFOUND', 'SEAT', FALSE, 8720, 1), + (10, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 8800, 1), + (11, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 8880, 1), + (12, TRUE, 'NOTFOUND', 'SEAT', FALSE, 8960, 1), + (13, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 9040, 1), + (14, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 9120, 1), + (15, TRUE, 'NOTFOUND', 'SEAT', FALSE, 9200, 1), + (16, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 9280, 1), + (17, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 9360, 1), + (18, TRUE, 'NOTFOUND', 'SEAT', FALSE, 9440, 1), + (19, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 9520, 1), + (20, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 9600, 1), + (21, TRUE, 'NOTFOUND', 'SEAT', FALSE, 9680, 1), + (22, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 9760, 1), + (23, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 9840, 1), + (24, TRUE, 'NOTFOUND', 'SEAT', FALSE, 9920, 1), + (25, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 10000, 1), + (26, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 10080, 1), + (27, TRUE, 'NOTFOUND', 'SEAT', FALSE, 10160, 1), + (28, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 10240, 1), + (29, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 10320, 1), + (30, TRUE, 'NOTFOUND', 'SEAT', FALSE, 10400, 1), + (31, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 10480, 1), + (32, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 10560, 1), + (33, TRUE, 'NOTFOUND', 'SEAT', FALSE, 10640, 1), + (34, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 10720, 1), + (35, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 10800, 1), + (36, TRUE, 'NOTFOUND', 'SEAT', FALSE, 10880, 1), + (37, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 10960, 1), + (38, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 11040, 1), + (39, TRUE, 'NOTFOUND', 'SEAT', FALSE, 11120, 1), + (40, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 11200, 1), + (41, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 11280, 1), + (42, TRUE, 'NOTFOUND', 'SEAT', FALSE, 11360, 1), + (43, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 11440, 1), + (44, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 11520, 1), + (45, TRUE, 'NOTFOUND', 'SEAT', FALSE, 11600, 1), + (46, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 11680, 1), + (47, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 11760, 1), + (48, TRUE, 'NOTFOUND', 'SEAT', FALSE, 11840, 1), + (49, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 11920, 1), + (50, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 12000, 1), + (51, TRUE, 'NOTFOUND', 'SEAT', FALSE, 12080, 1), + (52, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 12160, 1), + (53, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 12240, 1), + (54, TRUE, 'NOTFOUND', 'SEAT', FALSE, 12320, 1), + (55, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 12400, 1), + (56, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 12480, 1), + (57, TRUE, 'NOTFOUND', 'SEAT', FALSE, 12560, 1), + (58, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 12640, 1), + (59, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 12720, 1), + (60, TRUE, 'NOTFOUND', 'SEAT', FALSE, 12800, 1), + (61, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 12880, 1), + (62, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 12960, 1), + (63, TRUE, 'NOTFOUND', 'SEAT', FALSE, 13040, 1), + (64, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 13120, 1), + (65, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 13200, 1), + (66, TRUE, 'NOTFOUND', 'SEAT', FALSE, 13280, 1), + (67, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 13360, 1), + (68, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 13440, 1), + (69, TRUE, 'NOTFOUND', 'SEAT', FALSE, 13520, 1), + (70, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 13600, 1), + (71, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 13680, 1), + (72, TRUE, 'NOTFOUND', 'SEAT', FALSE, 13760, 1), + (73, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 13840, 1), + (74, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 13920, 1), + (75, TRUE, 'NOTFOUND', 'SEAT', FALSE, 14000, 1), + (76, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 14080, 1), + (77, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 14160, 1), + (78, TRUE, 'NOTFOUND', 'SEAT', FALSE, 14240, 1), + (79, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 14320, 1), + (80, TRUE, 'NOTFOUND', 'SEAT', FALSE, 14400, 1), + (81, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 14480, 1), + (82, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 14560, 1), + (83, TRUE, 'NOTFOUND', 'SEAT', FALSE, 14640, 1), + (84, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 14720, 1), + (85, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 14800, 1), + (86, TRUE, 'NOTFOUND', 'SEAT', FALSE, 14880, 1), + (87, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 14960, 1), + (88, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 15040, 1), + (89, TRUE, 'NOTFOUND', 'SEAT', FALSE, 15120, 1), + (90, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 15200, 1), + (91, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 15280, 1), + (92, TRUE, 'NOTFOUND', 'SEAT', FALSE, 15360, 1), + (93, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 15440, 1), + (94, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 15520, 1), + (95, TRUE, 'NOTFOUND', 'SEAT', FALSE, 15600, 1), + (96, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 15680, 1), + (97, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 15760, 1), + (98, TRUE, 'NOTFOUND', 'SEAT', FALSE, 15840, 1), + (99, TRUE, 'SEAT', 'STANDING_SEAT', FALSE, 15920, 1), + (100, FALSE, 'STANDING_SEAT', 'SEAT', FALSE, 16000, 1); \ No newline at end of file From a26f35b8d367654828365931722144acb18aa38b Mon Sep 17 00:00:00 2001 From: JunHyuk Yu Date: Fri, 16 Aug 2024 01:30:13 +0900 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20validation=20=EC=A2=85=EC=86=8D?= =?UTF-8?q?=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index bb5cf96..e3c8e91 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation "org.springframework.boot:spring-boot-starter-data-jpa" implementation 'com.mysql:mysql-connector-j' - + implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' implementation 'io.jsonwebtoken:jjwt-api:0.11.5' implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'