From 4190c573a3e2b97b0e43babb0f9dd2c8ed5a0154 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 18:14:18 +0900 Subject: [PATCH 01/27] =?UTF-8?q?[REFACTOR]=20=EB=A9=80=ED=8B=B0=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=83=9D=EC=84=B1=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD.yml | 2 +- .github/workflows/gradle.yml | 2 +- build.gradle | 97 +++++++------------ settings.gradle | 7 ++ .../org/umbba/UmbbaServerApplication.java | 15 +++ .../controller/ParentchildController.java | 24 ++--- .../dto/request/InviteCodeRequestDto.java | 2 +- .../request/OnboardingInviteRequestDto.java | 4 +- .../request/OnboardingReceiveRequestDto.java | 4 +- .../dto/response/InviteResultResponseDto.java | 9 +- .../response/OnboardingInviteResponseDto.java | 8 +- .../OnboardingReceiveResponseDto.java | 8 +- .../parentchild/dao/ParentchildDao.java | 6 +- .../domain/parentchild/model/Parentchild.java | 9 +- .../model/ParentchildRelation.java | 8 +- .../repository/ParentchildRepository.java | 4 +- .../service/ParentchildService.java | 38 ++++---- .../domain/qna/controller/QnAController.java | 14 +-- .../dto/request/TodayAnswerRequestDto.java | 2 +- .../response/GetInvitationResponseDto.java | 2 +- .../dto/response/GetMainViewResponseDto.java | 4 +- .../dto/response/QnAListResponseDto.java | 2 +- .../dto/response/SingleQnAResponseDto.java | 8 +- .../dto/response/TodayQnAResponseDto.java | 8 +- .../domain/qna/dao/QnADao.java | 4 +- .../domain/qna/model/OnboardingAnswer.java | 6 +- .../domain/qna/model/QnA.java | 4 +- .../domain/qna/model/Question.java | 4 +- .../domain/qna/model/QuestionSection.java | 2 +- .../domain/qna/model/QuestionType.java | 2 +- .../domain/qna/repository/QnARepository.java | 4 +- .../qna/repository/QuestionRepository.java | 8 +- .../domain/qna/service/QnAService.java | 39 ++++---- .../user/controller/AuthController.java | 20 ++-- .../dto/request/RefreshRequestDto.java | 2 +- .../dto/request/SocialLoginRequestDto.java | 2 +- .../controller/dto/request/UserInfoDto.java | 4 +- .../dto/response/UserLoginResponseDto.java | 8 +- .../domain/user/model/User.java | 10 +- .../user/repository/UserRepository.java | 8 +- .../domain/user/service/AuthService.java | 28 +++--- .../domain/user/social/SocialPlatform.java | 6 +- .../user/social/apple/AppleLoginService.java | 16 +-- .../social/apple/feign/AppleApiClient.java | 4 +- .../social/apple/response/ApplePublicKey.java | 2 +- .../apple/response/ApplePublicKeys.java | 6 +- .../apple/verify/AppleClaimsValidator.java | 2 +- .../social/apple/verify/AppleJwtParser.java | 6 +- .../social/apple/verify/EncryptUtils.java | 6 +- .../apple/verify/PublicKeyGenerator.java | 10 +- .../user/social/kakao/KakaoLoginService.java | 12 +-- .../social/kakao/feign/KakaoApiClient.java | 4 +- .../kakao/feign/KakaoAuthApiClient.java | 4 +- .../response/KakaoAccessTokenResponse.java | 2 +- .../social/kakao/response/KakaoAccount.java | 2 +- .../kakao/response/KakaoUserProfile.java | 2 +- .../kakao/response/KakaoUserResponse.java | 2 +- .../global/common/DemoController.java | 8 +- .../advice/ControllerExceptionAdvice.java | 10 +- .../global/common/dto/ApiResponse.java | 6 +- .../global/config/FCMConfig.java | 8 +- .../global/config/ScheduleConfig.java | 4 +- .../global/config/SecurityConfig.java | 6 +- .../CustomJwtAuthenticationEntryPoint.java | 6 +- .../config/auth/JwtAuthenticationFilter.java | 6 +- .../config/auth/UserAuthentication.java | 2 +- .../global/config/jwt/JwtProvider.java | 11 +-- .../global/config/jwt/JwtValidationType.java | 2 +- .../global/config/jwt/TokenDto.java | 2 +- .../global/config/jwt/redis/RefreshToken.java | 2 +- .../config/jwt/redis/TokenRepository.java | 2 +- .../global/exception/CustomException.java | 2 +- .../global/exception/ErrorType.java | 2 +- .../global/exception/SuccessType.java | 3 +- .../global/util/AuditingTimeEntity.java | 2 +- .../global/util/ServerProfileController.java | 2 +- .../global/util/fcm/FCMScheduler.java | 15 ++- .../global/util/fcm/FCMService.java | 24 ++--- .../util/fcm/controller/FCMController.java | 14 +-- .../util/fcm/controller/dto/FCMMessage.java | 2 +- .../fcm/controller/dto/FCMPushRequestDto.java | 5 +- .../util/fcm/controller/dto/PushMessage.java | 2 +- .../global/util/slack/SlackApi.java | 2 +- .../util/slack/SlackTestController.java | 4 +- .../umbbaServer/UmbbaServerApplication.java | 22 ----- .../UmbbaServerApplicationTests.java | 2 +- umbba-api/build.gradle | 28 ++++++ .../sopt/org/umbba/api/ApiApplication.java | 22 +++++ umbba-common/build.gradle | 11 +++ .../org/umbba/common/UmbbaCommonRoot.java | 8 ++ umbba-domain/build.gradle | 37 +++++++ .../org/umbba/domain/UmbbaDomainRoot.java | 7 ++ umbba-external/build.gradle | 12 +++ .../org/umbba/external/UmbbaExternalRoot.java | 7 ++ umbba-notification/.gitignore | 42 ++++++++ umbba-notification/build.gradle | 22 +++++ .../notification/NotificationApplication.java | 21 ++++ 97 files changed, 552 insertions(+), 371 deletions(-) create mode 100644 src/main/java/sopt/org/umbba/UmbbaServerApplication.java rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/controller/ParentchildController.java (66%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java (87%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java (81%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/controller/dto/response/InviteResultResponseDto.java (82%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java (79%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java (78%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/dao/ParentchildDao.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/model/Parentchild.java (87%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/model/ParentchildRelation.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/repository/ParentchildRepository.java (77%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/parentchild/service/ParentchildService.java (81%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/controller/QnAController.java (84%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/controller/dto/request/TodayAnswerRequestDto.java (90%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/controller/dto/response/GetInvitationResponseDto.java (96%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/controller/dto/response/GetMainViewResponseDto.java (85%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/controller/dto/response/QnAListResponseDto.java (84%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/controller/dto/response/SingleQnAResponseDto.java (89%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/controller/dto/response/TodayQnAResponseDto.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/dao/QnADao.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/model/OnboardingAnswer.java (78%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/model/QnA.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/model/Question.java (87%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/model/QuestionSection.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/model/QuestionType.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/repository/QnARepository.java (67%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/repository/QuestionRepository.java (86%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/qna/service/QnAService.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/controller/AuthController.java (76%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/controller/dto/request/RefreshRequestDto.java (85%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/controller/dto/request/SocialLoginRequestDto.java (86%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/controller/dto/request/UserInfoDto.java (89%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/controller/dto/response/UserLoginResponseDto.java (87%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/model/User.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/repository/UserRepository.java (77%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/service/AuthService.java (83%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/SocialPlatform.java (78%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/AppleLoginService.java (66%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/feign/AppleApiClient.java (68%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/response/ApplePublicKey.java (85%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/response/ApplePublicKeys.java (77%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/verify/AppleClaimsValidator.java (93%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/verify/AppleJwtParser.java (90%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/verify/EncryptUtils.java (80%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/apple/verify/PublicKeyGenerator.java (83%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/kakao/KakaoLoginService.java (82%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/kakao/feign/KakaoApiClient.java (79%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/kakao/feign/KakaoAuthApiClient.java (84%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/kakao/response/KakaoAccessTokenResponse.java (90%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/kakao/response/KakaoAccount.java (85%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/kakao/response/KakaoUserProfile.java (86%) rename src/main/java/sopt/org/{umbbaServer => umbba}/domain/user/social/kakao/response/KakaoUserResponse.java (88%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/common/DemoController.java (86%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/common/advice/ControllerExceptionAdvice.java (96%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/common/dto/ApiResponse.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/FCMConfig.java (93%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/ScheduleConfig.java (93%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/SecurityConfig.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/auth/CustomJwtAuthenticationEntryPoint.java (87%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/auth/JwtAuthenticationFilter.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/auth/UserAuthentication.java (90%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/jwt/JwtProvider.java (94%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/jwt/JwtValidationType.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/jwt/TokenDto.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/jwt/redis/RefreshToken.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/config/jwt/redis/TokenRepository.java (76%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/exception/CustomException.java (88%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/exception/ErrorType.java (99%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/exception/SuccessType.java (96%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/AuditingTimeEntity.java (93%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/ServerProfileController.java (92%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/fcm/FCMScheduler.java (78%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/fcm/FCMService.java (94%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/fcm/controller/FCMController.java (82%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/fcm/controller/dto/FCMMessage.java (97%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/fcm/controller/dto/FCMPushRequestDto.java (90%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/fcm/controller/dto/PushMessage.java (91%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/slack/SlackApi.java (98%) rename src/main/java/sopt/org/{umbbaServer => umbba}/global/util/slack/SlackTestController.java (84%) delete mode 100644 src/main/java/sopt/org/umbbaServer/UmbbaServerApplication.java rename src/test/java/sopt/org/{umbbaServer => umbba}/UmbbaServerApplicationTests.java (86%) create mode 100644 umbba-api/build.gradle create mode 100644 umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java create mode 100644 umbba-common/build.gradle create mode 100644 umbba-common/src/main/java/sopt/org/umbba/common/UmbbaCommonRoot.java create mode 100644 umbba-domain/build.gradle create mode 100644 umbba-domain/src/main/java/sopt/org/umbba/domain/UmbbaDomainRoot.java create mode 100644 umbba-external/build.gradle create mode 100644 umbba-external/src/main/java/sopt/org/umbba/external/UmbbaExternalRoot.java create mode 100644 umbba-notification/.gitignore create mode 100644 umbba-notification/build.gradle create mode 100644 umbba-notification/src/main/java/sopt/org/umbba/notification/NotificationApplication.java diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 3003dbb8..dd93a10c 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -37,7 +37,7 @@ jobs: aws-region: ap-northeast-2 # 3) 환경변수 파일 생성 - - name: make application.properties 파일 생성 + - name: make application.yaml 파일 생성 run: | # application.yml 파일 생성 cd ./src/main/resources diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 55e3ffeb..72c66fe0 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -41,7 +41,7 @@ jobs: distribution: 'temurin' # 3) 환경변수 파일 생성 - - name: make application.properties 파일 생성 + - name: make application.yaml 파일 생성 run: | ## create application.yml cd ./src/main/resources diff --git a/build.gradle b/build.gradle index 05d6e9a8..ac4f0e2f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,74 +1,51 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '2.7.13' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' -} - -group = 'sopt.org' -version = '0.0.1-SNAPSHOT' - -java { - sourceCompatibility = '11' -} +buildscript { + ext { + springBootVersion = "2.7.14" + } -configurations { - compileOnly { - extendsFrom annotationProcessor + repositories { + mavenCentral() } -} -repositories { - mavenCentral() + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") + } } -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-validation' - compileOnly 'org.projectlombok:lombok' - annotationProcessor 'org.projectlombok:lombok' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - - // Health Check - implementation 'org.springframework.boot:spring-boot-starter-actuator' - - // JPA & Database - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'mysql:mysql-connector-java:8.0.32' +subprojects { + group = "sopt.org.umbba" + version = '0.0.1-SNAPSHOT' - //JSON - implementation 'com.googlecode.json-simple:json-simple:1.1.1' + apply plugin: "java-library" + apply plugin: "org.springframework.boot" + apply plugin: "io.spring.dependency-management" - // Slack Webhook - implementation 'com.slack.api:slack-api-client:1.28.0' - implementation 'com.google.code.gson:gson:2.10.1' - implementation 'com.squareup.okhttp3:okhttp:4.10.0' - implementation 'com.slack.api:slack-app-backend:1.28.0' - implementation 'com.slack.api:slack-api-model:1.28.0' + sourceCompatibility = "11" - // JWT - implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.2' - implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.2' - implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2' - - // Spring Security - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.security:spring-security-test' - - // Redis - implementation 'org.springframework.boot:spring-boot-starter-data-redis' + repositories { + mavenCentral() + } - // Social Login - implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.7' + configurations { + compileOnly { + extendsFrom annotationProcessor + } + } - // random String - implementation 'org.apache.commons:commons-lang3' + dependencies { + implementation "org.springframework.boot:spring-boot-starter-validation" + testImplementation "org.springframework.boot:spring-boot-starter-test" - // Firebase - implementation 'com.google.firebase:firebase-admin:9.1.1' + // lombok + compileOnly "org.projectlombok:lombok" + annotationProcessor "org.projectlombok:lombok" + // Health Check + implementation 'org.springframework.boot:spring-boot-starter-actuator' -} + } -tasks.named('test') { - useJUnitPlatform() -} + test { + useJUnitPlatform() + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 05a1b1b2..12ede70b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,8 @@ rootProject.name = 'umbbaServer' + +include 'umbba-common' +include 'umbba-domain' +include 'umbba-external' +include 'umbba-api' +include 'umbba-notification' + diff --git a/src/main/java/sopt/org/umbba/UmbbaServerApplication.java b/src/main/java/sopt/org/umbba/UmbbaServerApplication.java new file mode 100644 index 00000000..eccb1e78 --- /dev/null +++ b/src/main/java/sopt/org/umbba/UmbbaServerApplication.java @@ -0,0 +1,15 @@ +package sopt.org.umbba; + +//@EnableJpaAuditing +//@EnableScheduling +//@SpringBootApplication(exclude = { UserDetailsServiceAutoConfiguration.class }) +//@EnableFeignClients +//public class UmbbaServerApplication { +// +// public static void main(String[] args) { +// +// SpringApplication.run(UmbbaServerApplication.class, args); +// +// } +// +//} diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/ParentchildController.java b/src/main/java/sopt/org/umbba/domain/parentchild/controller/ParentchildController.java similarity index 66% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/ParentchildController.java rename to src/main/java/sopt/org/umbba/domain/parentchild/controller/ParentchildController.java index 58e6e3d9..85330179 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/ParentchildController.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/controller/ParentchildController.java @@ -1,20 +1,20 @@ -package sopt.org.umbbaServer.domain.parentchild.controller; +package sopt.org.umbba.domain.parentchild.controller; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.request.InviteCodeRequestDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.request.OnboardingInviteRequestDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.request.OnboardingReceiveRequestDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.response.InviteResultResponseDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.response.OnboardingInviteResponseDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.response.OnboardingReceiveResponseDto; -import sopt.org.umbbaServer.domain.parentchild.service.ParentchildService; -import sopt.org.umbbaServer.domain.qna.service.QnAService; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.config.jwt.JwtProvider; -import sopt.org.umbbaServer.global.exception.SuccessType; +import sopt.org.umbba.domain.parentchild.controller.dto.request.InviteCodeRequestDto; +import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingInviteRequestDto; +import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingReceiveRequestDto; +import sopt.org.umbba.domain.parentchild.controller.dto.response.InviteResultResponseDto; +import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingInviteResponseDto; +import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingReceiveResponseDto; +import sopt.org.umbba.domain.parentchild.service.ParentchildService; +import sopt.org.umbba.domain.qna.service.QnAService; +import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.global.config.jwt.JwtProvider; +import sopt.org.umbba.global.exception.SuccessType; import javax.validation.Valid; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java rename to src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java index 485786f7..a32930fb 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.parentchild.controller.dto.request; +package sopt.org.umbba.domain.parentchild.controller.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java similarity index 87% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java rename to src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java index 243bcb8c..d68aeef9 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.parentchild.controller.dto.request; +package sopt.org.umbba.domain.parentchild.controller.dto.request; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; @@ -8,7 +8,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; -import sopt.org.umbbaServer.domain.user.controller.dto.request.UserInfoDto; +import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; import javax.validation.Valid; import javax.validation.constraints.NotEmpty; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java similarity index 81% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java rename to src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java index 15f99d24..c8fd4de8 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java @@ -1,11 +1,11 @@ -package sopt.org.umbbaServer.domain.parentchild.controller.dto.request; +package sopt.org.umbba.domain.parentchild.controller.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; -import sopt.org.umbbaServer.domain.user.controller.dto.request.UserInfoDto; +import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; import javax.validation.Valid; import javax.validation.constraints.NotEmpty; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/InviteResultResponseDto.java b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/InviteResultResponseDto.java similarity index 82% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/InviteResultResponseDto.java rename to src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/InviteResultResponseDto.java index 5007d36e..8417d6fd 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/InviteResultResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/InviteResultResponseDto.java @@ -1,14 +1,13 @@ -package sopt.org.umbbaServer.domain.parentchild.controller.dto.response; +package sopt.org.umbba.domain.parentchild.controller.dto.response; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.user.controller.dto.request.UserInfoDto; -import sopt.org.umbbaServer.domain.user.model.User; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; +import sopt.org.umbba.domain.user.model.User; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java similarity index 79% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java rename to src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java index c8fa6b37..e0c1f6ea 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java @@ -1,13 +1,13 @@ -package sopt.org.umbbaServer.domain.parentchild.controller.dto.response; +package sopt.org.umbba.domain.parentchild.controller.dto.response; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.user.controller.dto.request.UserInfoDto; -import sopt.org.umbbaServer.domain.user.model.User; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; +import sopt.org.umbba.domain.user.model.User; import java.time.LocalTime; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java similarity index 78% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java rename to src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java index 91c52cf2..00c01fa1 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java @@ -1,13 +1,13 @@ -package sopt.org.umbbaServer.domain.parentchild.controller.dto.response; +package sopt.org.umbba.domain.parentchild.controller.dto.response; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.user.controller.dto.request.UserInfoDto; -import sopt.org.umbbaServer.domain.user.model.User; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; +import sopt.org.umbba.domain.user.model.User; import java.time.LocalTime; import java.util.List; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/dao/ParentchildDao.java b/src/main/java/sopt/org/umbba/domain/parentchild/dao/ParentchildDao.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/dao/ParentchildDao.java rename to src/main/java/sopt/org/umbba/domain/parentchild/dao/ParentchildDao.java index a21c66a1..2e2342fb 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/dao/ParentchildDao.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/dao/ParentchildDao.java @@ -1,9 +1,9 @@ -package sopt.org.umbbaServer.domain.parentchild.dao; +package sopt.org.umbba.domain.parentchild.dao; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.user.model.User; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.user.model.User; import javax.persistence.EntityManager; import javax.persistence.NoResultException; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/Parentchild.java b/src/main/java/sopt/org/umbba/domain/parentchild/model/Parentchild.java similarity index 87% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/model/Parentchild.java rename to src/main/java/sopt/org/umbba/domain/parentchild/model/Parentchild.java index 166c5a0e..3bc83166 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/Parentchild.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/model/Parentchild.java @@ -1,11 +1,10 @@ -package sopt.org.umbbaServer.domain.parentchild.model; +package sopt.org.umbba.domain.parentchild.model; import lombok.*; import lombok.extern.slf4j.Slf4j; -import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbbaServer.domain.qna.model.OnboardingAnswer; -import sopt.org.umbbaServer.domain.qna.model.QnA; -import sopt.org.umbbaServer.global.util.AuditingTimeEntity; +import sopt.org.umbba.domain.qna.model.OnboardingAnswer; +import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.global.util.AuditingTimeEntity; import javax.persistence.*; import java.time.LocalTime; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/ParentchildRelation.java b/src/main/java/sopt/org/umbba/domain/parentchild/model/ParentchildRelation.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/model/ParentchildRelation.java rename to src/main/java/sopt/org/umbba/domain/parentchild/model/ParentchildRelation.java index 4ed3a377..b420f265 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/ParentchildRelation.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/model/ParentchildRelation.java @@ -1,11 +1,11 @@ -package sopt.org.umbbaServer.domain.parentchild.model; +package sopt.org.umbba.domain.parentchild.model; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import java.util.List; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/repository/ParentchildRepository.java b/src/main/java/sopt/org/umbba/domain/parentchild/repository/ParentchildRepository.java similarity index 77% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/repository/ParentchildRepository.java rename to src/main/java/sopt/org/umbba/domain/parentchild/repository/ParentchildRepository.java index 6915353a..d9623c81 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/repository/ParentchildRepository.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/repository/ParentchildRepository.java @@ -1,7 +1,7 @@ -package sopt.org.umbbaServer.domain.parentchild.repository; +package sopt.org.umbba.domain.parentchild.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.parentchild.model.Parentchild; import java.util.List; import java.util.Optional; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/service/ParentchildService.java b/src/main/java/sopt/org/umbba/domain/parentchild/service/ParentchildService.java similarity index 81% rename from src/main/java/sopt/org/umbbaServer/domain/parentchild/service/ParentchildService.java rename to src/main/java/sopt/org/umbba/domain/parentchild/service/ParentchildService.java index 65140a58..0d0fde68 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/service/ParentchildService.java +++ b/src/main/java/sopt/org/umbba/domain/parentchild/service/ParentchildService.java @@ -1,28 +1,28 @@ -package sopt.org.umbbaServer.domain.parentchild.service; +package sopt.org.umbba.domain.parentchild.service; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.RandomStringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.request.InviteCodeRequestDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.request.OnboardingInviteRequestDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.request.OnboardingReceiveRequestDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.response.InviteResultResponseDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.response.OnboardingInviteResponseDto; -import sopt.org.umbbaServer.domain.parentchild.controller.dto.response.OnboardingReceiveResponseDto; -import sopt.org.umbbaServer.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.parentchild.model.ParentchildRelation; -import sopt.org.umbbaServer.domain.parentchild.repository.ParentchildRepository; -import sopt.org.umbbaServer.domain.qna.model.OnboardingAnswer; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.repository.UserRepository; -import sopt.org.umbbaServer.global.config.ScheduleConfig; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.util.fcm.FCMScheduler; -import sopt.org.umbbaServer.global.util.fcm.FCMService; +import sopt.org.umbba.domain.parentchild.controller.dto.request.InviteCodeRequestDto; +import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingInviteRequestDto; +import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingReceiveRequestDto; +import sopt.org.umbba.domain.parentchild.controller.dto.response.InviteResultResponseDto; +import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingInviteResponseDto; +import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingReceiveResponseDto; +import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.parentchild.model.ParentchildRelation; +import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository; +import sopt.org.umbba.domain.qna.model.OnboardingAnswer; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.repository.UserRepository; +import sopt.org.umbba.global.config.ScheduleConfig; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.global.util.fcm.FCMScheduler; +import sopt.org.umbba.global.util.fcm.FCMService; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/QnAController.java b/src/main/java/sopt/org/umbba/domain/qna/controller/QnAController.java similarity index 84% rename from src/main/java/sopt/org/umbbaServer/domain/qna/controller/QnAController.java rename to src/main/java/sopt/org/umbba/domain/qna/controller/QnAController.java index c201a206..04aabdbe 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/QnAController.java +++ b/src/main/java/sopt/org/umbba/domain/qna/controller/QnAController.java @@ -1,14 +1,14 @@ -package sopt.org.umbbaServer.domain.qna.controller; +package sopt.org.umbba.domain.qna.controller; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbbaServer.domain.qna.controller.dto.request.TodayAnswerRequestDto; -import sopt.org.umbbaServer.domain.qna.controller.dto.response.*; -import sopt.org.umbbaServer.domain.qna.service.QnAService; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.config.jwt.JwtProvider; -import sopt.org.umbbaServer.global.exception.SuccessType; +import sopt.org.umbba.domain.qna.controller.dto.request.TodayAnswerRequestDto; +import sopt.org.umbba.domain.qna.controller.dto.response.*; +import sopt.org.umbba.domain.qna.service.QnAService; +import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.global.config.jwt.JwtProvider; +import sopt.org.umbba.global.exception.SuccessType; import javax.validation.Valid; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/request/TodayAnswerRequestDto.java b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/request/TodayAnswerRequestDto.java similarity index 90% rename from src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/request/TodayAnswerRequestDto.java rename to src/main/java/sopt/org/umbba/domain/qna/controller/dto/request/TodayAnswerRequestDto.java index f988ca22..c97a9826 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/request/TodayAnswerRequestDto.java +++ b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/request/TodayAnswerRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.qna.controller.dto.request; +package sopt.org.umbba.domain.qna.controller.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/GetInvitationResponseDto.java b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetInvitationResponseDto.java similarity index 96% rename from src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/GetInvitationResponseDto.java rename to src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetInvitationResponseDto.java index 7677d6ee..72bea792 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/GetInvitationResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetInvitationResponseDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.qna.controller.dto.response; +package sopt.org.umbba.domain.qna.controller.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/GetMainViewResponseDto.java b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetMainViewResponseDto.java similarity index 85% rename from src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/GetMainViewResponseDto.java rename to src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetMainViewResponseDto.java index 858a09ec..6cf83fb6 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/GetMainViewResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetMainViewResponseDto.java @@ -1,10 +1,10 @@ -package sopt.org.umbbaServer.domain.qna.controller.dto.response; +package sopt.org.umbba.domain.qna.controller.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.qna.model.QnA; +import sopt.org.umbba.domain.qna.model.QnA; @Getter @Builder diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/QnAListResponseDto.java b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/QnAListResponseDto.java similarity index 84% rename from src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/QnAListResponseDto.java rename to src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/QnAListResponseDto.java index a5d65dd8..b46602aa 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/QnAListResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/QnAListResponseDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.qna.controller.dto.response; +package sopt.org.umbba.domain.qna.controller.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/SingleQnAResponseDto.java b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/SingleQnAResponseDto.java similarity index 89% rename from src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/SingleQnAResponseDto.java rename to src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/SingleQnAResponseDto.java index 6e17205b..0f4b4d39 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/SingleQnAResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/SingleQnAResponseDto.java @@ -1,12 +1,12 @@ -package sopt.org.umbbaServer.domain.qna.controller.dto.response; +package sopt.org.umbba.domain.qna.controller.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.qna.model.QnA; -import sopt.org.umbbaServer.domain.qna.model.Question; -import sopt.org.umbbaServer.domain.user.model.User; +import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.domain.qna.model.Question; +import sopt.org.umbba.domain.user.model.User; @Getter @Builder diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/TodayQnAResponseDto.java b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/TodayQnAResponseDto.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/TodayQnAResponseDto.java rename to src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/TodayQnAResponseDto.java index be1d374b..5fab4337 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/TodayQnAResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/TodayQnAResponseDto.java @@ -1,12 +1,12 @@ -package sopt.org.umbbaServer.domain.qna.controller.dto.response; +package sopt.org.umbba.domain.qna.controller.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.qna.model.QnA; -import sopt.org.umbbaServer.domain.qna.model.Question; -import sopt.org.umbbaServer.domain.user.model.User; +import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.domain.qna.model.Question; +import sopt.org.umbba.domain.user.model.User; @Getter @Builder diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/dao/QnADao.java b/src/main/java/sopt/org/umbba/domain/qna/dao/QnADao.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/domain/qna/dao/QnADao.java rename to src/main/java/sopt/org/umbba/domain/qna/dao/QnADao.java index f46b3367..12dae991 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/dao/QnADao.java +++ b/src/main/java/sopt/org/umbba/domain/qna/dao/QnADao.java @@ -1,8 +1,8 @@ -package sopt.org.umbbaServer.domain.qna.dao; +package sopt.org.umbba.domain.qna.dao; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; -import sopt.org.umbbaServer.domain.qna.model.QnA; +import sopt.org.umbba.domain.qna.model.QnA; import javax.persistence.EntityManager; import javax.persistence.NoResultException; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/model/OnboardingAnswer.java b/src/main/java/sopt/org/umbba/domain/qna/model/OnboardingAnswer.java similarity index 78% rename from src/main/java/sopt/org/umbbaServer/domain/qna/model/OnboardingAnswer.java rename to src/main/java/sopt/org/umbba/domain/qna/model/OnboardingAnswer.java index ab604828..b31d7c0c 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/model/OnboardingAnswer.java +++ b/src/main/java/sopt/org/umbba/domain/qna/model/OnboardingAnswer.java @@ -1,10 +1,10 @@ -package sopt.org.umbbaServer.domain.qna.model; +package sopt.org.umbba.domain.qna.model; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/model/QnA.java b/src/main/java/sopt/org/umbba/domain/qna/model/QnA.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/domain/qna/model/QnA.java rename to src/main/java/sopt/org/umbba/domain/qna/model/QnA.java index c81672f6..855994ea 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/model/QnA.java +++ b/src/main/java/sopt/org/umbba/domain/qna/model/QnA.java @@ -1,7 +1,7 @@ -package sopt.org.umbbaServer.domain.qna.model; +package sopt.org.umbba.domain.qna.model; import lombok.*; -import sopt.org.umbbaServer.global.util.AuditingTimeEntity; +import sopt.org.umbba.global.util.AuditingTimeEntity; import javax.persistence.*; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/model/Question.java b/src/main/java/sopt/org/umbba/domain/qna/model/Question.java similarity index 87% rename from src/main/java/sopt/org/umbbaServer/domain/qna/model/Question.java rename to src/main/java/sopt/org/umbba/domain/qna/model/Question.java index 5b24e078..7b785328 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/model/Question.java +++ b/src/main/java/sopt/org/umbba/domain/qna/model/Question.java @@ -1,7 +1,7 @@ -package sopt.org.umbbaServer.domain.qna.model; +package sopt.org.umbba.domain.qna.model; import lombok.*; -import sopt.org.umbbaServer.global.util.AuditingTimeEntity; +import sopt.org.umbba.global.util.AuditingTimeEntity; import javax.persistence.*; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/model/QuestionSection.java b/src/main/java/sopt/org/umbba/domain/qna/model/QuestionSection.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/domain/qna/model/QuestionSection.java rename to src/main/java/sopt/org/umbba/domain/qna/model/QuestionSection.java index 219a8c6d..e2aaedf4 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/model/QuestionSection.java +++ b/src/main/java/sopt/org/umbba/domain/qna/model/QuestionSection.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.qna.model; +package sopt.org.umbba.domain.qna.model; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/model/QuestionType.java b/src/main/java/sopt/org/umbba/domain/qna/model/QuestionType.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/domain/qna/model/QuestionType.java rename to src/main/java/sopt/org/umbba/domain/qna/model/QuestionType.java index c9a5e088..183eb903 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/model/QuestionType.java +++ b/src/main/java/sopt/org/umbba/domain/qna/model/QuestionType.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.qna.model; +package sopt.org.umbba.domain.qna.model; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/repository/QnARepository.java b/src/main/java/sopt/org/umbba/domain/qna/repository/QnARepository.java similarity index 67% rename from src/main/java/sopt/org/umbbaServer/domain/qna/repository/QnARepository.java rename to src/main/java/sopt/org/umbba/domain/qna/repository/QnARepository.java index 4bc4033e..efc10085 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/repository/QnARepository.java +++ b/src/main/java/sopt/org/umbba/domain/qna/repository/QnARepository.java @@ -1,7 +1,7 @@ -package sopt.org.umbbaServer.domain.qna.repository; +package sopt.org.umbba.domain.qna.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbbaServer.domain.qna.model.QnA; +import sopt.org.umbba.domain.qna.model.QnA; import java.util.Optional; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/repository/QuestionRepository.java b/src/main/java/sopt/org/umbba/domain/qna/repository/QuestionRepository.java similarity index 86% rename from src/main/java/sopt/org/umbbaServer/domain/qna/repository/QuestionRepository.java rename to src/main/java/sopt/org/umbba/domain/qna/repository/QuestionRepository.java index bd7aa833..6dda7764 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/repository/QuestionRepository.java +++ b/src/main/java/sopt/org/umbba/domain/qna/repository/QuestionRepository.java @@ -1,9 +1,9 @@ -package sopt.org.umbbaServer.domain.qna.repository; +package sopt.org.umbba.domain.qna.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbbaServer.domain.qna.model.Question; -import sopt.org.umbbaServer.domain.qna.model.QuestionSection; -import sopt.org.umbbaServer.domain.qna.model.QuestionType; +import sopt.org.umbba.domain.qna.model.Question; +import sopt.org.umbba.domain.qna.model.QuestionSection; +import sopt.org.umbba.domain.qna.model.QuestionType; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java b/src/main/java/sopt/org/umbba/domain/qna/service/QnAService.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java rename to src/main/java/sopt/org/umbba/domain/qna/service/QnAService.java index a4a3e2e5..edd2a75d 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java +++ b/src/main/java/sopt/org/umbba/domain/qna/service/QnAService.java @@ -1,34 +1,33 @@ -package sopt.org.umbbaServer.domain.qna.service; +package sopt.org.umbba.domain.qna.service; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbbaServer.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.qna.controller.dto.request.TodayAnswerRequestDto; -import sopt.org.umbbaServer.domain.qna.controller.dto.response.*; -import sopt.org.umbbaServer.domain.qna.model.*; -import sopt.org.umbbaServer.domain.qna.repository.QnARepository; -import sopt.org.umbbaServer.domain.qna.repository.QuestionRepository; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.repository.UserRepository; -import sopt.org.umbbaServer.domain.user.social.SocialPlatform; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.util.fcm.FCMService; -import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMPushRequestDto; - -import java.util.ArrayList; +import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.qna.controller.dto.request.TodayAnswerRequestDto; +import sopt.org.umbba.domain.qna.controller.dto.response.*; +import sopt.org.umbba.domain.qna.model.*; +import sopt.org.umbba.domain.qna.repository.QnARepository; +import sopt.org.umbba.domain.qna.repository.QuestionRepository; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.repository.UserRepository; +import sopt.org.umbba.domain.user.social.SocialPlatform; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.global.util.fcm.FCMService; +import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; + import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; -import static sopt.org.umbbaServer.domain.qna.model.OnboardingAnswer.*; -import static sopt.org.umbbaServer.domain.qna.model.QuestionSection.*; -import static sopt.org.umbbaServer.domain.qna.model.QuestionType.*; +import static sopt.org.umbba.domain.qna.model.OnboardingAnswer.*; +import static sopt.org.umbba.domain.qna.model.QuestionSection.*; +import static sopt.org.umbba.domain.qna.model.QuestionType.*; @Slf4j @Service diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/controller/AuthController.java b/src/main/java/sopt/org/umbba/domain/user/controller/AuthController.java similarity index 76% rename from src/main/java/sopt/org/umbbaServer/domain/user/controller/AuthController.java rename to src/main/java/sopt/org/umbba/domain/user/controller/AuthController.java index eb1110e8..608b353f 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/controller/AuthController.java +++ b/src/main/java/sopt/org/umbba/domain/user/controller/AuthController.java @@ -1,17 +1,17 @@ -package sopt.org.umbbaServer.domain.user.controller; +package sopt.org.umbba.domain.user.controller; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbbaServer.domain.user.controller.dto.request.RefreshRequestDto; -import sopt.org.umbbaServer.domain.user.controller.dto.request.SocialLoginRequestDto; -import sopt.org.umbbaServer.domain.user.controller.dto.response.UserLoginResponseDto; -import sopt.org.umbbaServer.domain.user.service.AuthService; -import sopt.org.umbbaServer.domain.user.social.kakao.KakaoLoginService; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.config.jwt.JwtProvider; -import sopt.org.umbbaServer.global.config.jwt.TokenDto; -import sopt.org.umbbaServer.global.exception.SuccessType; +import sopt.org.umbba.domain.user.controller.dto.request.RefreshRequestDto; +import sopt.org.umbba.domain.user.controller.dto.request.SocialLoginRequestDto; +import sopt.org.umbba.domain.user.controller.dto.response.UserLoginResponseDto; +import sopt.org.umbba.domain.user.service.AuthService; +import sopt.org.umbba.domain.user.social.kakao.KakaoLoginService; +import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.global.config.jwt.JwtProvider; +import sopt.org.umbba.global.config.jwt.TokenDto; +import sopt.org.umbba.global.exception.SuccessType; import java.security.NoSuchAlgorithmException; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/RefreshRequestDto.java b/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/RefreshRequestDto.java similarity index 85% rename from src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/RefreshRequestDto.java rename to src/main/java/sopt/org/umbba/domain/user/controller/dto/request/RefreshRequestDto.java index a0551ba5..0f802b7a 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/RefreshRequestDto.java +++ b/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/RefreshRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.controller.dto.request; +package sopt.org.umbba.domain.user.controller.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/SocialLoginRequestDto.java b/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/SocialLoginRequestDto.java similarity index 86% rename from src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/SocialLoginRequestDto.java rename to src/main/java/sopt/org/umbba/domain/user/controller/dto/request/SocialLoginRequestDto.java index 5917fefa..5de9e66f 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/SocialLoginRequestDto.java +++ b/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/SocialLoginRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.controller.dto.request; +package sopt.org.umbba.domain.user.controller.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/UserInfoDto.java b/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/UserInfoDto.java similarity index 89% rename from src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/UserInfoDto.java rename to src/main/java/sopt/org/umbba/domain/user/controller/dto/request/UserInfoDto.java index b37a1115..5ed563f7 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/UserInfoDto.java +++ b/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/UserInfoDto.java @@ -1,10 +1,10 @@ -package sopt.org.umbbaServer.domain.user.controller.dto.request; +package sopt.org.umbba.domain.user.controller.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.user.model.User; +import sopt.org.umbba.domain.user.model.User; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/response/UserLoginResponseDto.java b/src/main/java/sopt/org/umbba/domain/user/controller/dto/response/UserLoginResponseDto.java similarity index 87% rename from src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/response/UserLoginResponseDto.java rename to src/main/java/sopt/org/umbba/domain/user/controller/dto/response/UserLoginResponseDto.java index 4aede703..01e3c8ff 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/response/UserLoginResponseDto.java +++ b/src/main/java/sopt/org/umbba/domain/user/controller/dto/response/UserLoginResponseDto.java @@ -1,12 +1,12 @@ -package sopt.org.umbbaServer.domain.user.controller.dto.response; +package sopt.org.umbba.domain.user.controller.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.social.SocialPlatform; -import sopt.org.umbbaServer.global.config.jwt.TokenDto; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.social.SocialPlatform; +import sopt.org.umbba.global.config.jwt.TokenDto; @Getter @Builder diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/model/User.java b/src/main/java/sopt/org/umbba/domain/user/model/User.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/domain/user/model/User.java rename to src/main/java/sopt/org/umbba/domain/user/model/User.java index 098e5745..fc5eb9fd 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/model/User.java +++ b/src/main/java/sopt/org/umbba/domain/user/model/User.java @@ -1,12 +1,10 @@ -package sopt.org.umbbaServer.domain.user.model; +package sopt.org.umbba.domain.user.model; import lombok.*; import lombok.extern.slf4j.Slf4j; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.user.social.SocialPlatform; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.util.AuditingTimeEntity; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.user.social.SocialPlatform; +import sopt.org.umbba.global.util.AuditingTimeEntity; import javax.persistence.*; import java.util.List; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/repository/UserRepository.java b/src/main/java/sopt/org/umbba/domain/user/repository/UserRepository.java similarity index 77% rename from src/main/java/sopt/org/umbbaServer/domain/user/repository/UserRepository.java rename to src/main/java/sopt/org/umbba/domain/user/repository/UserRepository.java index f513945d..1da2a7df 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/repository/UserRepository.java +++ b/src/main/java/sopt/org/umbba/domain/user/repository/UserRepository.java @@ -1,9 +1,9 @@ -package sopt.org.umbbaServer.domain.user.repository; +package sopt.org.umbba.domain.user.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.social.SocialPlatform; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.social.SocialPlatform; import java.util.List; import java.util.Optional; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/service/AuthService.java b/src/main/java/sopt/org/umbba/domain/user/service/AuthService.java similarity index 83% rename from src/main/java/sopt/org/umbbaServer/domain/user/service/AuthService.java rename to src/main/java/sopt/org/umbba/domain/user/service/AuthService.java index a3f60407..c7d76bc7 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/service/AuthService.java +++ b/src/main/java/sopt/org/umbba/domain/user/service/AuthService.java @@ -1,23 +1,23 @@ -package sopt.org.umbbaServer.domain.user.service; +package sopt.org.umbba.domain.user.service; import feign.FeignException; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbbaServer.domain.user.controller.dto.request.RefreshRequestDto; -import sopt.org.umbbaServer.domain.user.controller.dto.request.SocialLoginRequestDto; -import sopt.org.umbbaServer.domain.user.controller.dto.response.UserLoginResponseDto; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.repository.UserRepository; -import sopt.org.umbbaServer.domain.user.social.SocialPlatform; -import sopt.org.umbbaServer.domain.user.social.apple.AppleLoginService; -import sopt.org.umbbaServer.domain.user.social.kakao.KakaoLoginService; -import sopt.org.umbbaServer.global.config.auth.UserAuthentication; -import sopt.org.umbbaServer.global.config.jwt.JwtProvider; -import sopt.org.umbbaServer.global.config.jwt.TokenDto; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.domain.user.controller.dto.request.RefreshRequestDto; +import sopt.org.umbba.domain.user.controller.dto.request.SocialLoginRequestDto; +import sopt.org.umbba.domain.user.controller.dto.response.UserLoginResponseDto; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.repository.UserRepository; +import sopt.org.umbba.domain.user.social.SocialPlatform; +import sopt.org.umbba.domain.user.social.apple.AppleLoginService; +import sopt.org.umbba.domain.user.social.kakao.KakaoLoginService; +import sopt.org.umbba.global.config.auth.UserAuthentication; +import sopt.org.umbba.global.config.jwt.JwtProvider; +import sopt.org.umbba.global.config.jwt.TokenDto; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/SocialPlatform.java b/src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java similarity index 78% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/SocialPlatform.java rename to src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java index dd742562..e50221bf 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/SocialPlatform.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java @@ -1,10 +1,10 @@ -package sopt.org.umbbaServer.domain.user.social; +package sopt.org.umbba.domain.user.social; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/AppleLoginService.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java similarity index 66% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/AppleLoginService.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java index a4438666..1156997c 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/AppleLoginService.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java @@ -1,15 +1,15 @@ -package sopt.org.umbbaServer.domain.user.social.apple; +package sopt.org.umbba.domain.user.social.apple; import io.jsonwebtoken.Claims; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; -import sopt.org.umbbaServer.domain.user.social.apple.feign.AppleApiClient; -import sopt.org.umbbaServer.domain.user.social.apple.response.ApplePublicKeys; -import sopt.org.umbbaServer.domain.user.social.apple.verify.AppleClaimsValidator; -import sopt.org.umbbaServer.domain.user.social.apple.verify.AppleJwtParser; -import sopt.org.umbbaServer.domain.user.social.apple.verify.PublicKeyGenerator; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.domain.user.social.apple.feign.AppleApiClient; +import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKeys; +import sopt.org.umbba.domain.user.social.apple.verify.AppleClaimsValidator; +import sopt.org.umbba.domain.user.social.apple.verify.AppleJwtParser; +import sopt.org.umbba.domain.user.social.apple.verify.PublicKeyGenerator; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import java.security.PublicKey; import java.util.Map; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/feign/AppleApiClient.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/feign/AppleApiClient.java similarity index 68% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/feign/AppleApiClient.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/feign/AppleApiClient.java index 5ff1d4e4..69098c3a 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/feign/AppleApiClient.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/feign/AppleApiClient.java @@ -1,8 +1,8 @@ -package sopt.org.umbbaServer.domain.user.social.apple.feign; +package sopt.org.umbba.domain.user.social.apple.feign; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; -import sopt.org.umbbaServer.domain.user.social.apple.response.ApplePublicKeys; +import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKeys; @FeignClient(name = "apple-public-verify-client", url = "https://appleid.apple.com/auth") public interface AppleApiClient { diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/response/ApplePublicKey.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKey.java similarity index 85% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/response/ApplePublicKey.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKey.java index 071f7523..38d7c841 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/response/ApplePublicKey.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKey.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.social.apple.response; +package sopt.org.umbba.domain.user.social.apple.response; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/response/ApplePublicKeys.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKeys.java similarity index 77% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/response/ApplePublicKeys.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKeys.java index 0bc79d64..e88efb99 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/response/ApplePublicKeys.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKeys.java @@ -1,11 +1,11 @@ -package sopt.org.umbbaServer.domain.user.social.apple.response; +package sopt.org.umbba.domain.user.social.apple.response; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import java.util.List; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/AppleClaimsValidator.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java similarity index 93% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/AppleClaimsValidator.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java index e5eb7500..4cb61faf 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/AppleClaimsValidator.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.social.apple.verify; +package sopt.org.umbba.domain.user.social.apple.verify; import io.jsonwebtoken.Claims; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/AppleJwtParser.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java similarity index 90% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/AppleJwtParser.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java index 88e5f6bf..2ea6410f 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/AppleJwtParser.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java @@ -1,12 +1,12 @@ -package sopt.org.umbbaServer.domain.user.social.apple.verify; +package sopt.org.umbba.domain.user.social.apple.verify; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.jsonwebtoken.*; import org.springframework.stereotype.Component; import org.springframework.util.Base64Utils; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import java.security.PublicKey; import java.util.Map; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/EncryptUtils.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java similarity index 80% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/EncryptUtils.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java index 486b0902..1ed01b13 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/EncryptUtils.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java @@ -1,7 +1,7 @@ -package sopt.org.umbbaServer.domain.user.social.apple.verify; +package sopt.org.umbba.domain.user.social.apple.verify; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/PublicKeyGenerator.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java similarity index 83% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/PublicKeyGenerator.java rename to src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java index b2c37944..7f2a63fb 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/apple/verify/PublicKeyGenerator.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java @@ -1,11 +1,11 @@ -package sopt.org.umbbaServer.domain.user.social.apple.verify; +package sopt.org.umbba.domain.user.social.apple.verify; import org.springframework.stereotype.Component; import org.springframework.util.Base64Utils; -import sopt.org.umbbaServer.domain.user.social.apple.response.ApplePublicKey; -import sopt.org.umbbaServer.domain.user.social.apple.response.ApplePublicKeys; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKey; +import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKeys; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import java.math.BigInteger; import java.security.KeyFactory; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/KakaoLoginService.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java similarity index 82% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/KakaoLoginService.java rename to src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java index 54f18bda..46d97471 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/KakaoLoginService.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java @@ -1,14 +1,14 @@ -package sopt.org.umbbaServer.domain.user.social.kakao; +package sopt.org.umbba.domain.user.social.kakao; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.social.kakao.feign.KakaoApiClient; -import sopt.org.umbbaServer.domain.user.social.kakao.feign.KakaoAuthApiClient; -import sopt.org.umbbaServer.domain.user.social.kakao.response.KakaoAccessTokenResponse; -import sopt.org.umbbaServer.domain.user.social.kakao.response.KakaoUserResponse; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.social.kakao.feign.KakaoApiClient; +import sopt.org.umbba.domain.user.social.kakao.feign.KakaoAuthApiClient; +import sopt.org.umbba.domain.user.social.kakao.response.KakaoAccessTokenResponse; +import sopt.org.umbba.domain.user.social.kakao.response.KakaoUserResponse; @Service @Transactional diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/feign/KakaoApiClient.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoApiClient.java similarity index 79% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/feign/KakaoApiClient.java rename to src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoApiClient.java index c1521a00..fb64a6e9 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/feign/KakaoApiClient.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoApiClient.java @@ -1,10 +1,10 @@ -package sopt.org.umbbaServer.domain.user.social.kakao.feign; +package sopt.org.umbba.domain.user.social.kakao.feign; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestHeader; -import sopt.org.umbbaServer.domain.user.social.kakao.response.KakaoUserResponse; +import sopt.org.umbba.domain.user.social.kakao.response.KakaoUserResponse; @FeignClient(name = "kakaoApiClient", url = "https://kapi.kakao.com") public interface KakaoApiClient { diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/feign/KakaoAuthApiClient.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoAuthApiClient.java similarity index 84% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/feign/KakaoAuthApiClient.java rename to src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoAuthApiClient.java index b5d277e9..99264731 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/feign/KakaoAuthApiClient.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoAuthApiClient.java @@ -1,10 +1,10 @@ -package sopt.org.umbbaServer.domain.user.social.kakao.feign; +package sopt.org.umbba.domain.user.social.kakao.feign; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; -import sopt.org.umbbaServer.domain.user.social.kakao.response.KakaoAccessTokenResponse; +import sopt.org.umbba.domain.user.social.kakao.response.KakaoAccessTokenResponse; @FeignClient(name = "kakaoAuthApiClient", url = "https://kauth.kakao.com") public interface KakaoAuthApiClient { diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoAccessTokenResponse.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccessTokenResponse.java similarity index 90% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoAccessTokenResponse.java rename to src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccessTokenResponse.java index 81aaec52..4deb44da 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoAccessTokenResponse.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccessTokenResponse.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.social.kakao.response; +package sopt.org.umbba.domain.user.social.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoAccount.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccount.java similarity index 85% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoAccount.java rename to src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccount.java index 14a37c8f..f83a7d2b 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoAccount.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccount.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.social.kakao.response; +package sopt.org.umbba.domain.user.social.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoUserProfile.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserProfile.java similarity index 86% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoUserProfile.java rename to src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserProfile.java index 6f7e8aff..9bcdd3ff 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoUserProfile.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserProfile.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.social.kakao.response; +package sopt.org.umbba.domain.user.social.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoUserResponse.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserResponse.java similarity index 88% rename from src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoUserResponse.java rename to src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserResponse.java index 7c46edbe..c1ee9438 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/social/kakao/response/KakaoUserResponse.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserResponse.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.domain.user.social.kakao.response; +package sopt.org.umbba.domain.user.social.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/global/common/DemoController.java b/src/main/java/sopt/org/umbba/global/common/DemoController.java similarity index 86% rename from src/main/java/sopt/org/umbbaServer/global/common/DemoController.java rename to src/main/java/sopt/org/umbba/global/common/DemoController.java index ffebea2a..62f5ab93 100644 --- a/src/main/java/sopt/org/umbbaServer/global/common/DemoController.java +++ b/src/main/java/sopt/org/umbba/global/common/DemoController.java @@ -1,11 +1,11 @@ -package sopt.org.umbbaServer.global.common; +package sopt.org.umbba.global.common; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbbaServer.domain.qna.service.QnAService; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.exception.SuccessType; +import sopt.org.umbba.domain.qna.service.QnAService; +import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.global.exception.SuccessType; @RestController @RequiredArgsConstructor diff --git a/src/main/java/sopt/org/umbbaServer/global/common/advice/ControllerExceptionAdvice.java b/src/main/java/sopt/org/umbba/global/common/advice/ControllerExceptionAdvice.java similarity index 96% rename from src/main/java/sopt/org/umbbaServer/global/common/advice/ControllerExceptionAdvice.java rename to src/main/java/sopt/org/umbba/global/common/advice/ControllerExceptionAdvice.java index 41562cdc..897d5fbb 100644 --- a/src/main/java/sopt/org/umbbaServer/global/common/advice/ControllerExceptionAdvice.java +++ b/src/main/java/sopt/org/umbba/global/common/advice/ControllerExceptionAdvice.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.common.advice; +package sopt.org.umbba.global.common.advice; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -15,10 +15,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.util.slack.SlackApi; +import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.global.util.slack.SlackApi; import javax.servlet.http.HttpServletRequest; import javax.validation.UnexpectedTypeException; diff --git a/src/main/java/sopt/org/umbbaServer/global/common/dto/ApiResponse.java b/src/main/java/sopt/org/umbba/global/common/dto/ApiResponse.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/global/common/dto/ApiResponse.java rename to src/main/java/sopt/org/umbba/global/common/dto/ApiResponse.java index ce638ddc..a19032ce 100644 --- a/src/main/java/sopt/org/umbbaServer/global/common/dto/ApiResponse.java +++ b/src/main/java/sopt/org/umbba/global/common/dto/ApiResponse.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.common.dto; +package sopt.org.umbba.global.common.dto; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -6,8 +6,8 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.exception.SuccessType; +import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.global.exception.SuccessType; @Getter @JsonPropertyOrder({"status", "message", "data"}) diff --git a/src/main/java/sopt/org/umbbaServer/global/config/FCMConfig.java b/src/main/java/sopt/org/umbba/global/config/FCMConfig.java similarity index 93% rename from src/main/java/sopt/org/umbbaServer/global/config/FCMConfig.java rename to src/main/java/sopt/org/umbba/global/config/FCMConfig.java index 806c791e..e354a30c 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/FCMConfig.java +++ b/src/main/java/sopt/org/umbba/global/config/FCMConfig.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config; +package sopt.org.umbba.global.config; import com.google.auth.oauth2.GoogleCredentials; import com.google.firebase.FirebaseApp; @@ -9,9 +9,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMPushRequestDto; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; import javax.annotation.PostConstruct; import java.io.IOException; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/ScheduleConfig.java b/src/main/java/sopt/org/umbba/global/config/ScheduleConfig.java similarity index 93% rename from src/main/java/sopt/org/umbbaServer/global/config/ScheduleConfig.java rename to src/main/java/sopt/org/umbba/global/config/ScheduleConfig.java index cff0eb21..9ee77f75 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/ScheduleConfig.java +++ b/src/main/java/sopt/org/umbba/global/config/ScheduleConfig.java @@ -1,10 +1,10 @@ -package sopt.org.umbbaServer.global.config; +package sopt.org.umbba.global.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; -import sopt.org.umbbaServer.global.util.fcm.FCMService; +import sopt.org.umbba.global.util.fcm.FCMService; import java.util.concurrent.ThreadPoolExecutor; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/SecurityConfig.java b/src/main/java/sopt/org/umbba/global/config/SecurityConfig.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/global/config/SecurityConfig.java rename to src/main/java/sopt/org/umbba/global/config/SecurityConfig.java index 8e32578f..3fcb1904 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/SecurityConfig.java +++ b/src/main/java/sopt/org/umbba/global/config/SecurityConfig.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config; +package sopt.org.umbba.global.config; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; @@ -8,8 +8,8 @@ import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import sopt.org.umbbaServer.global.config.auth.CustomJwtAuthenticationEntryPoint; -import sopt.org.umbbaServer.global.config.auth.JwtAuthenticationFilter; +import sopt.org.umbba.global.config.auth.CustomJwtAuthenticationEntryPoint; +import sopt.org.umbba.global.config.auth.JwtAuthenticationFilter; @Configuration @EnableWebSecurity diff --git a/src/main/java/sopt/org/umbbaServer/global/config/auth/CustomJwtAuthenticationEntryPoint.java b/src/main/java/sopt/org/umbba/global/config/auth/CustomJwtAuthenticationEntryPoint.java similarity index 87% rename from src/main/java/sopt/org/umbbaServer/global/config/auth/CustomJwtAuthenticationEntryPoint.java rename to src/main/java/sopt/org/umbba/global/config/auth/CustomJwtAuthenticationEntryPoint.java index 530f1dce..c03827fa 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/auth/CustomJwtAuthenticationEntryPoint.java +++ b/src/main/java/sopt/org/umbba/global/config/auth/CustomJwtAuthenticationEntryPoint.java @@ -1,12 +1,12 @@ -package sopt.org.umbbaServer.global.config.auth; +package sopt.org.umbba.global.config.auth; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.http.MediaType; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.stereotype.Component; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.global.exception.ErrorType; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/auth/JwtAuthenticationFilter.java b/src/main/java/sopt/org/umbba/global/config/auth/JwtAuthenticationFilter.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/global/config/auth/JwtAuthenticationFilter.java rename to src/main/java/sopt/org/umbba/global/config/auth/JwtAuthenticationFilter.java index 4c77d09b..3f3a0429 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/auth/JwtAuthenticationFilter.java +++ b/src/main/java/sopt/org/umbba/global/config/auth/JwtAuthenticationFilter.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config.auth; +package sopt.org.umbba.global.config.auth; import lombok.NonNull; import lombok.RequiredArgsConstructor; @@ -8,8 +8,8 @@ import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import org.springframework.web.filter.OncePerRequestFilter; -import sopt.org.umbbaServer.global.config.jwt.JwtValidationType; -import sopt.org.umbbaServer.global.config.jwt.JwtProvider; +import sopt.org.umbba.global.config.jwt.JwtValidationType; +import sopt.org.umbba.global.config.jwt.JwtProvider; import javax.servlet.FilterChain; import javax.servlet.ServletException; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/auth/UserAuthentication.java b/src/main/java/sopt/org/umbba/global/config/auth/UserAuthentication.java similarity index 90% rename from src/main/java/sopt/org/umbbaServer/global/config/auth/UserAuthentication.java rename to src/main/java/sopt/org/umbba/global/config/auth/UserAuthentication.java index 75ba55d6..1b5dbd26 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/auth/UserAuthentication.java +++ b/src/main/java/sopt/org/umbba/global/config/auth/UserAuthentication.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config.auth; +package sopt.org.umbba.global.config.auth; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/jwt/JwtProvider.java b/src/main/java/sopt/org/umbba/global/config/jwt/JwtProvider.java similarity index 94% rename from src/main/java/sopt/org/umbbaServer/global/config/jwt/JwtProvider.java rename to src/main/java/sopt/org/umbba/global/config/jwt/JwtProvider.java index ea2dac14..a6ff86b5 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/jwt/JwtProvider.java +++ b/src/main/java/sopt/org/umbba/global/config/jwt/JwtProvider.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config.jwt; +package sopt.org.umbba.global.config.jwt; import io.jsonwebtoken.*; @@ -8,10 +8,10 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; -import sopt.org.umbbaServer.global.config.jwt.redis.RefreshToken; -import sopt.org.umbbaServer.global.config.jwt.redis.TokenRepository; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; +import sopt.org.umbba.global.config.jwt.redis.RefreshToken; +import sopt.org.umbba.global.config.jwt.redis.TokenRepository; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; import javax.annotation.PostConstruct; import javax.crypto.SecretKey; @@ -19,7 +19,6 @@ import java.security.Principal; import java.util.Base64; import java.util.Date; -import java.util.UUID; import static java.util.Objects.isNull; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/jwt/JwtValidationType.java b/src/main/java/sopt/org/umbba/global/config/jwt/JwtValidationType.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/global/config/jwt/JwtValidationType.java rename to src/main/java/sopt/org/umbba/global/config/jwt/JwtValidationType.java index 54c5d739..c8b3ec85 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/jwt/JwtValidationType.java +++ b/src/main/java/sopt/org/umbba/global/config/jwt/JwtValidationType.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config.jwt; +package sopt.org.umbba.global.config.jwt; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/jwt/TokenDto.java b/src/main/java/sopt/org/umbba/global/config/jwt/TokenDto.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/global/config/jwt/TokenDto.java rename to src/main/java/sopt/org/umbba/global/config/jwt/TokenDto.java index e41cadd3..6e54c174 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/jwt/TokenDto.java +++ b/src/main/java/sopt/org/umbba/global/config/jwt/TokenDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config.jwt; +package sopt.org.umbba.global.config.jwt; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/jwt/redis/RefreshToken.java b/src/main/java/sopt/org/umbba/global/config/jwt/redis/RefreshToken.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/global/config/jwt/redis/RefreshToken.java rename to src/main/java/sopt/org/umbba/global/config/jwt/redis/RefreshToken.java index 9fbe2a3f..2313e7ac 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/jwt/redis/RefreshToken.java +++ b/src/main/java/sopt/org/umbba/global/config/jwt/redis/RefreshToken.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config.jwt.redis; +package sopt.org.umbba.global.config.jwt.redis; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbbaServer/global/config/jwt/redis/TokenRepository.java b/src/main/java/sopt/org/umbba/global/config/jwt/redis/TokenRepository.java similarity index 76% rename from src/main/java/sopt/org/umbbaServer/global/config/jwt/redis/TokenRepository.java rename to src/main/java/sopt/org/umbba/global/config/jwt/redis/TokenRepository.java index c37664f0..b9f7b87e 100644 --- a/src/main/java/sopt/org/umbbaServer/global/config/jwt/redis/TokenRepository.java +++ b/src/main/java/sopt/org/umbba/global/config/jwt/redis/TokenRepository.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.config.jwt.redis; +package sopt.org.umbba.global.config.jwt.redis; import org.springframework.data.repository.CrudRepository; diff --git a/src/main/java/sopt/org/umbbaServer/global/exception/CustomException.java b/src/main/java/sopt/org/umbba/global/exception/CustomException.java similarity index 88% rename from src/main/java/sopt/org/umbbaServer/global/exception/CustomException.java rename to src/main/java/sopt/org/umbba/global/exception/CustomException.java index 5539429e..c4869c63 100644 --- a/src/main/java/sopt/org/umbbaServer/global/exception/CustomException.java +++ b/src/main/java/sopt/org/umbba/global/exception/CustomException.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.exception; +package sopt.org.umbba.global.exception; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbbaServer/global/exception/ErrorType.java b/src/main/java/sopt/org/umbba/global/exception/ErrorType.java similarity index 99% rename from src/main/java/sopt/org/umbbaServer/global/exception/ErrorType.java rename to src/main/java/sopt/org/umbba/global/exception/ErrorType.java index 73c386b8..64b2decc 100644 --- a/src/main/java/sopt/org/umbbaServer/global/exception/ErrorType.java +++ b/src/main/java/sopt/org/umbba/global/exception/ErrorType.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.exception; +package sopt.org.umbba.global.exception; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbbaServer/global/exception/SuccessType.java b/src/main/java/sopt/org/umbba/global/exception/SuccessType.java similarity index 96% rename from src/main/java/sopt/org/umbbaServer/global/exception/SuccessType.java rename to src/main/java/sopt/org/umbba/global/exception/SuccessType.java index 2b59321c..7a8ae1e9 100644 --- a/src/main/java/sopt/org/umbbaServer/global/exception/SuccessType.java +++ b/src/main/java/sopt/org/umbba/global/exception/SuccessType.java @@ -1,6 +1,5 @@ -package sopt.org.umbbaServer.global.exception; +package sopt.org.umbba.global.exception; -import com.google.api.Http; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/AuditingTimeEntity.java b/src/main/java/sopt/org/umbba/global/util/AuditingTimeEntity.java similarity index 93% rename from src/main/java/sopt/org/umbbaServer/global/util/AuditingTimeEntity.java rename to src/main/java/sopt/org/umbba/global/util/AuditingTimeEntity.java index e400d722..347accae 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/AuditingTimeEntity.java +++ b/src/main/java/sopt/org/umbba/global/util/AuditingTimeEntity.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.util; +package sopt.org.umbba.global.util; import lombok.Getter; import org.springframework.data.annotation.CreatedDate; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/ServerProfileController.java b/src/main/java/sopt/org/umbba/global/util/ServerProfileController.java similarity index 92% rename from src/main/java/sopt/org/umbbaServer/global/util/ServerProfileController.java rename to src/main/java/sopt/org/umbba/global/util/ServerProfileController.java index bfbd1f77..81d7ab48 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/ServerProfileController.java +++ b/src/main/java/sopt/org/umbba/global/util/ServerProfileController.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.util; +package sopt.org.umbba.global.util; import lombok.RequiredArgsConstructor; import org.springframework.core.env.Environment; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/fcm/FCMScheduler.java b/src/main/java/sopt/org/umbba/global/util/fcm/FCMScheduler.java similarity index 78% rename from src/main/java/sopt/org/umbbaServer/global/util/fcm/FCMScheduler.java rename to src/main/java/sopt/org/umbba/global/util/fcm/FCMScheduler.java index 57083e6f..db32c876 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/fcm/FCMScheduler.java +++ b/src/main/java/sopt/org/umbba/global/util/fcm/FCMScheduler.java @@ -1,17 +1,14 @@ -package sopt.org.umbbaServer.global.util.fcm; +package sopt.org.umbba.global.util.fcm; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.RestController; -import sopt.org.umbbaServer.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbbaServer.domain.parentchild.repository.ParentchildRepository; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.repository.UserRepository; -import sopt.org.umbbaServer.domain.user.social.SocialPlatform; -import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMPushRequestDto; +import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; +import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.repository.UserRepository; +import sopt.org.umbba.domain.user.social.SocialPlatform; import java.util.List; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/fcm/FCMService.java b/src/main/java/sopt/org/umbba/global/util/fcm/FCMService.java similarity index 94% rename from src/main/java/sopt/org/umbbaServer/global/util/fcm/FCMService.java rename to src/main/java/sopt/org/umbba/global/util/fcm/FCMService.java index bb8d8d21..26fe778f 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/fcm/FCMService.java +++ b/src/main/java/sopt/org/umbba/global/util/fcm/FCMService.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.util.fcm; +package sopt.org.umbba.global.util.fcm; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -19,17 +19,17 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.DefaultTransactionDefinition; -import sopt.org.umbbaServer.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbbaServer.domain.parentchild.model.Parentchild; -import sopt.org.umbbaServer.domain.parentchild.repository.ParentchildRepository; -import sopt.org.umbbaServer.domain.qna.model.QnA; -import sopt.org.umbbaServer.domain.user.model.User; -import sopt.org.umbbaServer.domain.user.repository.UserRepository; -import sopt.org.umbbaServer.domain.user.social.SocialPlatform; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMMessage; -import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMPushRequestDto; +import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; +import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository; +import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.user.repository.UserRepository; +import sopt.org.umbba.domain.user.social.SocialPlatform; +import sopt.org.umbba.global.exception.CustomException; +import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.global.util.fcm.controller.dto.FCMMessage; +import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/FCMController.java b/src/main/java/sopt/org/umbba/global/util/fcm/controller/FCMController.java similarity index 82% rename from src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/FCMController.java rename to src/main/java/sopt/org/umbba/global/util/fcm/controller/FCMController.java index cbc994cb..70ea888a 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/FCMController.java +++ b/src/main/java/sopt/org/umbba/global/util/fcm/controller/FCMController.java @@ -1,14 +1,14 @@ -package sopt.org.umbbaServer.global.util.fcm.controller; +package sopt.org.umbba.global.util.fcm.controller; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.config.jwt.JwtProvider; -import sopt.org.umbbaServer.global.exception.SuccessType; -import sopt.org.umbbaServer.global.util.fcm.FCMScheduler; -import sopt.org.umbbaServer.global.util.fcm.FCMService; -import sopt.org.umbbaServer.global.util.fcm.controller.dto.FCMPushRequestDto; +import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.global.config.jwt.JwtProvider; +import sopt.org.umbba.global.exception.SuccessType; +import sopt.org.umbba.global.util.fcm.FCMScheduler; +import sopt.org.umbba.global.util.fcm.FCMService; +import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; import java.io.IOException; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/FCMMessage.java b/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMMessage.java similarity index 97% rename from src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/FCMMessage.java rename to src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMMessage.java index e363ef28..f52de117 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/FCMMessage.java +++ b/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMMessage.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.util.fcm.controller.dto; +package sopt.org.umbba.global.util.fcm.controller.dto; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/FCMPushRequestDto.java b/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMPushRequestDto.java similarity index 90% rename from src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/FCMPushRequestDto.java rename to src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMPushRequestDto.java index d5e528a4..784524db 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/FCMPushRequestDto.java +++ b/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMPushRequestDto.java @@ -1,12 +1,9 @@ -package sopt.org.umbbaServer.global.util.fcm.controller.dto; +package sopt.org.umbba.global.util.fcm.controller.dto; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.*; import lombok.extern.slf4j.Slf4j; -import java.util.logging.Logger; - @Slf4j @Getter @Builder diff --git a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/PushMessage.java b/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/PushMessage.java similarity index 91% rename from src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/PushMessage.java rename to src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/PushMessage.java index 35d205ec..2eb6f0b2 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/fcm/controller/dto/PushMessage.java +++ b/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/PushMessage.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.util.fcm.controller.dto; +package sopt.org.umbba.global.util.fcm.controller.dto; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/slack/SlackApi.java b/src/main/java/sopt/org/umbba/global/util/slack/SlackApi.java similarity index 98% rename from src/main/java/sopt/org/umbbaServer/global/util/slack/SlackApi.java rename to src/main/java/sopt/org/umbba/global/util/slack/SlackApi.java index 0030e4f8..ce9cefe0 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/slack/SlackApi.java +++ b/src/main/java/sopt/org/umbba/global/util/slack/SlackApi.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.util.slack; +package sopt.org.umbba.global.util.slack; import com.slack.api.Slack; import com.slack.api.model.block.Blocks; diff --git a/src/main/java/sopt/org/umbbaServer/global/util/slack/SlackTestController.java b/src/main/java/sopt/org/umbba/global/util/slack/SlackTestController.java similarity index 84% rename from src/main/java/sopt/org/umbbaServer/global/util/slack/SlackTestController.java rename to src/main/java/sopt/org/umbba/global/util/slack/SlackTestController.java index ffdb2507..02c75474 100644 --- a/src/main/java/sopt/org/umbbaServer/global/util/slack/SlackTestController.java +++ b/src/main/java/sopt/org/umbba/global/util/slack/SlackTestController.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer.global.util.slack; +package sopt.org.umbba.global.util.slack; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import sopt.org.umbbaServer.global.common.dto.ApiResponse; +import sopt.org.umbba.global.common.dto.ApiResponse; @Slf4j @RestController diff --git a/src/main/java/sopt/org/umbbaServer/UmbbaServerApplication.java b/src/main/java/sopt/org/umbbaServer/UmbbaServerApplication.java deleted file mode 100644 index 57184e14..00000000 --- a/src/main/java/sopt/org/umbbaServer/UmbbaServerApplication.java +++ /dev/null @@ -1,22 +0,0 @@ -package sopt.org.umbbaServer; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import org.springframework.scheduling.annotation.EnableScheduling; - -@EnableJpaAuditing -@EnableScheduling -@SpringBootApplication(exclude = { UserDetailsServiceAutoConfiguration.class }) -@EnableFeignClients -public class UmbbaServerApplication { - - public static void main(String[] args) { - - SpringApplication.run(UmbbaServerApplication.class, args); - - } - -} diff --git a/src/test/java/sopt/org/umbbaServer/UmbbaServerApplicationTests.java b/src/test/java/sopt/org/umbba/UmbbaServerApplicationTests.java similarity index 86% rename from src/test/java/sopt/org/umbbaServer/UmbbaServerApplicationTests.java rename to src/test/java/sopt/org/umbba/UmbbaServerApplicationTests.java index 580f0f43..51ffac6a 100644 --- a/src/test/java/sopt/org/umbbaServer/UmbbaServerApplicationTests.java +++ b/src/test/java/sopt/org/umbba/UmbbaServerApplicationTests.java @@ -1,4 +1,4 @@ -package sopt.org.umbbaServer; +package sopt.org.umbba; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; diff --git a/umbba-api/build.gradle b/umbba-api/build.gradle new file mode 100644 index 00000000..5e4fdc45 --- /dev/null +++ b/umbba-api/build.gradle @@ -0,0 +1,28 @@ +dependencies { + implementation project(':umbba-common') + implementation project(':umbba-domain') + implementation project(':umbba-external') + + // spring mvc + implementation 'org.springframework.boot:spring-boot-starter-web' + + // redis + implementation "org.springframework.boot:spring-boot-starter-data-redis" + implementation "org.springframework.session:spring-session-data-redis" + + // swagger +// implementation 'org.springdoc:springdoc-openapi-ui:1.5.4' + + // SQS + implementation "org.springframework.cloud:spring-cloud-aws-messaging:2.2.6.RELEASE" + + // Spring Security + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.security:spring-security-test' + + // random String + implementation 'org.apache.commons:commons-lang3' + + // s3 +// implementation "org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE" +} \ No newline at end of file diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java b/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java new file mode 100644 index 00000000..16235de2 --- /dev/null +++ b/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java @@ -0,0 +1,22 @@ +package sopt.org.umbba.api; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import sopt.org.umbba.common.UmbbaCommonRoot; +import sopt.org.umbba.domain.UmbbaDomainRoot; +import sopt.org.umbba.external.UmbbaExternalRoot; + +@SpringBootApplication(scanBasePackageClasses = { + UmbbaCommonRoot.class, + UmbbaDomainRoot.class, + UmbbaExternalRoot.class, + ApiApplication.class +}) +public class ApiApplication { + + public static void main(String[] args) { + SpringApplication.run(ApiApplication.class, args); + } + +} diff --git a/umbba-common/build.gradle b/umbba-common/build.gradle new file mode 100644 index 00000000..8708cbd0 --- /dev/null +++ b/umbba-common/build.gradle @@ -0,0 +1,11 @@ +bootJar { enabled = false } +jar { enabled = true } +dependencies { + // redis + implementation "org.springframework.boot:spring-boot-starter-data-redis" + + // jwt + implementation group: "io.jsonwebtoken", name: "jjwt-api", version: "0.11.2" + implementation group: "io.jsonwebtoken", name: "jjwt-impl", version: "0.11.2" + implementation group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2" +} \ No newline at end of file diff --git a/umbba-common/src/main/java/sopt/org/umbba/common/UmbbaCommonRoot.java b/umbba-common/src/main/java/sopt/org/umbba/common/UmbbaCommonRoot.java new file mode 100644 index 00000000..14910c5f --- /dev/null +++ b/umbba-common/src/main/java/sopt/org/umbba/common/UmbbaCommonRoot.java @@ -0,0 +1,8 @@ +package sopt.org.umbba.common; + +import org.springframework.context.annotation.ComponentScan; + +@ComponentScan(basePackageClasses = {UmbbaCommonRoot.class}) +public interface UmbbaCommonRoot { + +} diff --git a/umbba-domain/build.gradle b/umbba-domain/build.gradle new file mode 100644 index 00000000..5d917457 --- /dev/null +++ b/umbba-domain/build.gradle @@ -0,0 +1,37 @@ +bootJar { enabled = false } +jar { enabled = true } + +dependencies { + // JPA & Database + api "org.springframework.boot:spring-boot-starter-data-jpa" + implementation 'mysql:mysql-connector-java:8.0.32' +// runtimeOnly "mysql:mysql-connector-java" + + // JSON + implementation 'com.googlecode.json-simple:json-simple:1.1.1' + + // jackson +// implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: '2.12.7.1' + + // querydsl +// implementation "com.querydsl:querydsl-jpa" +// implementation "com.querydsl:querydsl-core" +// annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties["querydsl.version"]}:jpa" +// annotationProcessor "jakarta.persistence:jakarta.persistence-api:2.2.3" +// annotationProcessor "jakarta.annotation:jakarta.annotation-api:1.3.5" +} + +//def queryDslDir = "build/querydsl/generated" +// +//sourceSets { +// main.java.srcDirs += [queryDslDir] +//} +// +//tasks.withType(JavaCompile) { +// options.annotationProcessorGeneratedSourcesDirectory = file(queryDslDir) +//} +// +//clean.doLast { +// file(queryDslDir).deleteDir() +//} + diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/UmbbaDomainRoot.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/UmbbaDomainRoot.java new file mode 100644 index 00000000..0a867733 --- /dev/null +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/UmbbaDomainRoot.java @@ -0,0 +1,7 @@ +package sopt.org.umbba.domain; + +import org.springframework.context.annotation.ComponentScan; + +@ComponentScan(basePackageClasses = {UmbbaDomainRoot.class}) +public interface UmbbaDomainRoot { +} diff --git a/umbba-external/build.gradle b/umbba-external/build.gradle new file mode 100644 index 00000000..5ecee613 --- /dev/null +++ b/umbba-external/build.gradle @@ -0,0 +1,12 @@ +bootJar { enabled = false } +jar { enabled = true } + +dependencies { + implementation project(":umbba-common") + + // Social Login + implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.7' + + // spring webflux +// implementation "org.springframework.boot:spring-boot-starter-webflux" +} \ No newline at end of file diff --git a/umbba-external/src/main/java/sopt/org/umbba/external/UmbbaExternalRoot.java b/umbba-external/src/main/java/sopt/org/umbba/external/UmbbaExternalRoot.java new file mode 100644 index 00000000..09e80219 --- /dev/null +++ b/umbba-external/src/main/java/sopt/org/umbba/external/UmbbaExternalRoot.java @@ -0,0 +1,7 @@ +package sopt.org.umbba.external; + +import org.springframework.context.annotation.ComponentScan; + +@ComponentScan(basePackageClasses = {UmbbaExternalRoot.class}) +public interface UmbbaExternalRoot { +} diff --git a/umbba-notification/.gitignore b/umbba-notification/.gitignore new file mode 100644 index 00000000..b63da455 --- /dev/null +++ b/umbba-notification/.gitignore @@ -0,0 +1,42 @@ +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/umbba-notification/build.gradle b/umbba-notification/build.gradle new file mode 100644 index 00000000..f4783422 --- /dev/null +++ b/umbba-notification/build.gradle @@ -0,0 +1,22 @@ +dependencies { + implementation project(":umbba-domain") + implementation project(":umbba-common") + implementation project(":umbba-external") + + implementation "org.springframework.boot:spring-boot-starter-web" + + // SQS + implementation "org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE" + implementation "org.springframework.cloud:spring-cloud-aws-messaging:2.2.6.RELEASE" + + // FCM + implementation "com.google.firebase:firebase-admin:9.1.1" + + // Slack Webhook + implementation 'com.slack.api:slack-api-client:1.28.0' + implementation 'com.google.code.gson:gson:2.10.1' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.slack.api:slack-app-backend:1.28.0' + implementation 'com.slack.api:slack-api-model:1.28.0' + implementation project(path: ':umbba-common') +} \ No newline at end of file diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/NotificationApplication.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/NotificationApplication.java new file mode 100644 index 00000000..aa42b4e9 --- /dev/null +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/NotificationApplication.java @@ -0,0 +1,21 @@ +package sopt.org.umbba.notification; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import sopt.org.umbba.common.UmbbaCommonRoot; +import sopt.org.umbba.domain.UmbbaDomainRoot; +import sopt.org.umbba.external.UmbbaExternalRoot; + +@SpringBootApplication(scanBasePackageClasses = { + UmbbaCommonRoot.class, + UmbbaDomainRoot.class, + UmbbaExternalRoot.class, + NotificationApplication.class +})public class NotificationApplication { + + public static void main(String[] args) { + SpringApplication.run(NotificationApplication.class, args); + } + +} \ No newline at end of file From 7391292dd72d353ca35c23c27a4c4cf1325cab4d Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 20:51:32 +0900 Subject: [PATCH 02/27] =?UTF-8?q?[REFACTOR]=20common=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=20=EB=B6=84=EB=A6=AC=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umbba-common/build.gradle | 4 +++ .../umbba/common}/exception/ErrorType.java | 2 +- .../umbba/common}/exception/SuccessType.java | 2 +- .../common/exception}/dto/ApiResponse.java | 6 ++--- .../exception/model}/CustomException.java | 3 ++- .../org/umbba/common/sqs/MessageType.java | 12 +++++++++ .../org/umbba/common/sqs/MessageUtils.java | 17 ++++++++++++ .../org/umbba/common/sqs/dto/FirebaseDto.java | 26 +++++++++++++++++++ .../org/umbba/common/sqs/dto/MessageDto.java | 14 ++++++++++ .../org/umbba/common/sqs/dto/SlackDto.java | 26 +++++++++++++++++++ 10 files changed, 106 insertions(+), 6 deletions(-) rename {src/main/java/sopt/org/umbba/global => umbba-common/src/main/java/sopt/org/umbba/common}/exception/ErrorType.java (99%) rename {src/main/java/sopt/org/umbba/global => umbba-common/src/main/java/sopt/org/umbba/common}/exception/SuccessType.java (98%) rename {src/main/java/sopt/org/umbba/global/common => umbba-common/src/main/java/sopt/org/umbba/common/exception}/dto/ApiResponse.java (92%) rename {src/main/java/sopt/org/umbba/global/exception => umbba-common/src/main/java/sopt/org/umbba/common/exception/model}/CustomException.java (78%) create mode 100644 umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageType.java create mode 100644 umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageUtils.java create mode 100644 umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/FirebaseDto.java create mode 100644 umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/MessageDto.java create mode 100644 umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java diff --git a/umbba-common/build.gradle b/umbba-common/build.gradle index 8708cbd0..0021debc 100644 --- a/umbba-common/build.gradle +++ b/umbba-common/build.gradle @@ -1,6 +1,10 @@ bootJar { enabled = false } jar { enabled = true } dependencies { + + // for HttpStatus + implementation 'org.springframework.boot:spring-boot-starter-web' + // redis implementation "org.springframework.boot:spring-boot-starter-data-redis" diff --git a/src/main/java/sopt/org/umbba/global/exception/ErrorType.java b/umbba-common/src/main/java/sopt/org/umbba/common/exception/ErrorType.java similarity index 99% rename from src/main/java/sopt/org/umbba/global/exception/ErrorType.java rename to umbba-common/src/main/java/sopt/org/umbba/common/exception/ErrorType.java index 64b2decc..361b75eb 100644 --- a/src/main/java/sopt/org/umbba/global/exception/ErrorType.java +++ b/umbba-common/src/main/java/sopt/org/umbba/common/exception/ErrorType.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.exception; +package sopt.org.umbba.common.exception; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbba/global/exception/SuccessType.java b/umbba-common/src/main/java/sopt/org/umbba/common/exception/SuccessType.java similarity index 98% rename from src/main/java/sopt/org/umbba/global/exception/SuccessType.java rename to umbba-common/src/main/java/sopt/org/umbba/common/exception/SuccessType.java index 7a8ae1e9..c1ab240b 100644 --- a/src/main/java/sopt/org/umbba/global/exception/SuccessType.java +++ b/umbba-common/src/main/java/sopt/org/umbba/common/exception/SuccessType.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.exception; +package sopt.org.umbba.common.exception; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbba/global/common/dto/ApiResponse.java b/umbba-common/src/main/java/sopt/org/umbba/common/exception/dto/ApiResponse.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/common/dto/ApiResponse.java rename to umbba-common/src/main/java/sopt/org/umbba/common/exception/dto/ApiResponse.java index a19032ce..d86fc811 100644 --- a/src/main/java/sopt/org/umbba/global/common/dto/ApiResponse.java +++ b/umbba-common/src/main/java/sopt/org/umbba/common/exception/dto/ApiResponse.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.common.dto; +package sopt.org.umbba.common.exception.dto; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -6,8 +6,8 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbba.global.exception.ErrorType; -import sopt.org.umbba.global.exception.SuccessType; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.SuccessType; @Getter @JsonPropertyOrder({"status", "message", "data"}) diff --git a/src/main/java/sopt/org/umbba/global/exception/CustomException.java b/umbba-common/src/main/java/sopt/org/umbba/common/exception/model/CustomException.java similarity index 78% rename from src/main/java/sopt/org/umbba/global/exception/CustomException.java rename to umbba-common/src/main/java/sopt/org/umbba/common/exception/model/CustomException.java index c4869c63..8d4e568d 100644 --- a/src/main/java/sopt/org/umbba/global/exception/CustomException.java +++ b/umbba-common/src/main/java/sopt/org/umbba/common/exception/model/CustomException.java @@ -1,6 +1,7 @@ -package sopt.org.umbba.global.exception; +package sopt.org.umbba.common.exception.model; import lombok.Getter; +import sopt.org.umbba.common.exception.ErrorType; @Getter public class CustomException extends RuntimeException { diff --git a/umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageType.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageType.java new file mode 100644 index 00000000..2fd110db --- /dev/null +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageType.java @@ -0,0 +1,12 @@ +package sopt.org.umbba.common.sqs; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class MessageType { + + public static final String MESSAGE_TYPE_HEADER = "TYPE"; + public static final String FIREBASE = "FIREBASE"; + public static final String SLACK = "SLACK"; +} diff --git a/umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageUtils.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageUtils.java new file mode 100644 index 00000000..a2dcd1c7 --- /dev/null +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/MessageUtils.java @@ -0,0 +1,17 @@ +package sopt.org.umbba.common.sqs; + +public class MessageUtils { + + public static String generate(String message, P1 param1) { + return String.format(message, param1); + } + + public static String generate(String message, P1 param1, P2 param2) { + return String.format(message, param1, param2); + } + + public static String generate(String message, P1 param1, P2 param2, P3 param3) { + return String.format(message, param1, param2, param3); + } + +} diff --git a/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/FirebaseDto.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/FirebaseDto.java new file mode 100644 index 00000000..329e604d --- /dev/null +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/FirebaseDto.java @@ -0,0 +1,26 @@ +package sopt.org.umbba.common.sqs.dto; + +import lombok.*; +import lombok.experimental.SuperBuilder; +import sopt.org.umbba.common.sqs.MessageType; + +@ToString +@Getter +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@SuperBuilder +public class FirebaseDto extends MessageDto { + + private String fcmToken; + private String title; + private String body; + + public static FirebaseDto of(String fcmToken, String title, String body) { + return FirebaseDto.builder() + .type(MessageType.FIREBASE) + .fcmToken(fcmToken) + .title(title) + .body(body) + .build(); + } +} diff --git a/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/MessageDto.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/MessageDto.java new file mode 100644 index 00000000..84ea7620 --- /dev/null +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/MessageDto.java @@ -0,0 +1,14 @@ +package sopt.org.umbba.common.sqs.dto; + +import lombok.*; +import lombok.experimental.SuperBuilder; + +@ToString +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PROTECTED) +@SuperBuilder +public class MessageDto { + + protected String type; +} diff --git a/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java new file mode 100644 index 00000000..4126504b --- /dev/null +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java @@ -0,0 +1,26 @@ +package sopt.org.umbba.common.sqs.dto; + +import lombok.*; +import lombok.experimental.SuperBuilder; +import sopt.org.umbba.common.sqs.MessageType; + +@ToString +@Getter +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@SuperBuilder +public class SlackDto extends MessageDto { + + private Exception error; + private String requestMethod; + private String requestURI; + + public static SlackDto of(Exception error, String requestMethod, String requestURI) { + return SlackDto.builder() + .type(MessageType.SLACK) + .error(error) + .requestMethod(requestMethod) + .requestURI(requestURI) + .build(); + } +} From a4ccbbb2d7469e67b14d3bd65aa0ee52c6dcf906 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 21:04:33 +0900 Subject: [PATCH 03/27] =?UTF-8?q?[REFACTOR]=20external=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EB=B6=84=EB=A6=AC=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/user/social/SocialPlatform.java | 27 ------------------- .../user/social/apple/AppleLoginService.java | 2 +- .../apple/verify/AppleClaimsValidator.java | 2 +- .../social/apple/verify/AppleJwtParser.java | 2 +- .../social/apple/verify/EncryptUtils.java | 2 +- .../apple/verify/PublicKeyGenerator.java | 6 ++--- .../user/social/kakao/KakaoLoginService.java | 2 +- .../client/auth/apple}/AppleApiClient.java | 4 +-- .../auth}/apple/response/ApplePublicKey.java | 2 +- .../auth}/apple/response/ApplePublicKeys.java | 6 ++--- .../client/auth/kakao}/KakaoApiClient.java | 4 +-- .../auth/kakao}/KakaoAuthApiClient.java | 4 +-- .../response/KakaoAccessTokenResponse.java | 2 +- .../auth}/kakao/response/KakaoAccount.java | 2 +- .../kakao/response/KakaoUserProfile.java | 2 +- .../kakao/response/KakaoUserResponse.java | 2 +- 16 files changed, 22 insertions(+), 49 deletions(-) delete mode 100644 src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java rename {src/main/java/sopt/org/umbba/domain/user/social/apple/feign => umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple}/AppleApiClient.java (70%) rename {src/main/java/sopt/org/umbba/domain/user/social => umbba-external/src/main/java/sopt/org/umbba/external/client/auth}/apple/response/ApplePublicKey.java (86%) rename {src/main/java/sopt/org/umbba/domain/user/social => umbba-external/src/main/java/sopt/org/umbba/external/client/auth}/apple/response/ApplePublicKeys.java (78%) rename {src/main/java/sopt/org/umbba/domain/user/social/kakao/feign => umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao}/KakaoApiClient.java (80%) rename {src/main/java/sopt/org/umbba/domain/user/social/kakao/feign => umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao}/KakaoAuthApiClient.java (85%) rename {src/main/java/sopt/org/umbba/domain/user/social => umbba-external/src/main/java/sopt/org/umbba/external/client/auth}/kakao/response/KakaoAccessTokenResponse.java (90%) rename {src/main/java/sopt/org/umbba/domain/user/social => umbba-external/src/main/java/sopt/org/umbba/external/client/auth}/kakao/response/KakaoAccount.java (86%) rename {src/main/java/sopt/org/umbba/domain/user/social => umbba-external/src/main/java/sopt/org/umbba/external/client/auth}/kakao/response/KakaoUserProfile.java (87%) rename {src/main/java/sopt/org/umbba/domain/user/social => umbba-external/src/main/java/sopt/org/umbba/external/client/auth}/kakao/response/KakaoUserResponse.java (89%) diff --git a/src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java b/src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java deleted file mode 100644 index e50221bf..00000000 --- a/src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java +++ /dev/null @@ -1,27 +0,0 @@ -package sopt.org.umbba.domain.user.social; - -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; - -@Getter -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum SocialPlatform { - KAKAO("카카오"), - APPLE("애플"), - WITHDRAW("탈퇴한 유저") - ; - - private final String value; - - public static SocialPlatform of(String value) { - for (SocialPlatform platform : SocialPlatform.values()) { - if (platform.toString().equals(value)) { - return platform; - } - } - throw new CustomException(ErrorType.INVALID_SOCIALPLATFORM); - } -} \ No newline at end of file diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java index 1156997c..69fb104d 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.apple; +package sopt.org.umbba.external.client.auth.apple; import io.jsonwebtoken.Claims; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java index 4cb61faf..dd964e52 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.apple.verify; +package sopt.org.umbba.external.client.auth.apple.verify; import io.jsonwebtoken.Claims; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java index 2ea6410f..ee9bd093 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.apple.verify; +package sopt.org.umbba.external.client.auth.apple.verify; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java index 1ed01b13..b87a11f2 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.apple.verify; +package sopt.org.umbba.external.client.auth.apple.verify; import sopt.org.umbba.global.exception.CustomException; import sopt.org.umbba.global.exception.ErrorType; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java index 7f2a63fb..d01659ea 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java @@ -1,9 +1,9 @@ -package sopt.org.umbba.domain.user.social.apple.verify; +package sopt.org.umbba.external.client.auth.apple.verify; import org.springframework.stereotype.Component; import org.springframework.util.Base64Utils; -import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKey; -import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKeys; +import sopt.org.umbba.external.client.auth.apple.response.ApplePublicKey; +import sopt.org.umbba.external.client.auth.apple.response.ApplePublicKeys; import sopt.org.umbba.global.exception.CustomException; import sopt.org.umbba.global.exception.ErrorType; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java b/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java index 46d97471..19139026 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java +++ b/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.kakao; +package sopt.org.umbba.external.client.auth.kakao; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/feign/AppleApiClient.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/AppleApiClient.java similarity index 70% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/feign/AppleApiClient.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/AppleApiClient.java index 69098c3a..50897a71 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/feign/AppleApiClient.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/AppleApiClient.java @@ -1,8 +1,8 @@ -package sopt.org.umbba.domain.user.social.apple.feign; +package sopt.org.umbba.external.client.auth.apple; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; -import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKeys; +import sopt.org.umbba.external.client.auth.apple.response.ApplePublicKeys; @FeignClient(name = "apple-public-verify-client", url = "https://appleid.apple.com/auth") public interface AppleApiClient { diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKey.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/response/ApplePublicKey.java similarity index 86% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKey.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/response/ApplePublicKey.java index 38d7c841..402f9081 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKey.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/response/ApplePublicKey.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.apple.response; +package sopt.org.umbba.external.client.auth.apple.response; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKeys.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/response/ApplePublicKeys.java similarity index 78% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKeys.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/response/ApplePublicKeys.java index e88efb99..a3938682 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/response/ApplePublicKeys.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/apple/response/ApplePublicKeys.java @@ -1,11 +1,11 @@ -package sopt.org.umbba.domain.user.social.apple.response; +package sopt.org.umbba.external.client.auth.apple.response; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.common.exception.ErrorType; import java.util.List; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoApiClient.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/KakaoApiClient.java similarity index 80% rename from src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoApiClient.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/KakaoApiClient.java index fb64a6e9..6d7d9769 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoApiClient.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/KakaoApiClient.java @@ -1,10 +1,10 @@ -package sopt.org.umbba.domain.user.social.kakao.feign; +package sopt.org.umbba.external.client.auth.kakao; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestHeader; -import sopt.org.umbba.domain.user.social.kakao.response.KakaoUserResponse; +import sopt.org.umbba.external.client.auth.kakao.response.KakaoUserResponse; @FeignClient(name = "kakaoApiClient", url = "https://kapi.kakao.com") public interface KakaoApiClient { diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoAuthApiClient.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/KakaoAuthApiClient.java similarity index 85% rename from src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoAuthApiClient.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/KakaoAuthApiClient.java index 99264731..a39f765d 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/feign/KakaoAuthApiClient.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/KakaoAuthApiClient.java @@ -1,10 +1,10 @@ -package sopt.org.umbba.domain.user.social.kakao.feign; +package sopt.org.umbba.external.client.auth.kakao; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; -import sopt.org.umbba.domain.user.social.kakao.response.KakaoAccessTokenResponse; +import sopt.org.umbba.external.client.auth.kakao.response.KakaoAccessTokenResponse; @FeignClient(name = "kakaoAuthApiClient", url = "https://kauth.kakao.com") public interface KakaoAuthApiClient { diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccessTokenResponse.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoAccessTokenResponse.java similarity index 90% rename from src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccessTokenResponse.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoAccessTokenResponse.java index 4deb44da..2305ae7a 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccessTokenResponse.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoAccessTokenResponse.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.kakao.response; +package sopt.org.umbba.external.client.auth.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccount.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoAccount.java similarity index 86% rename from src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccount.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoAccount.java index f83a7d2b..0a673876 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoAccount.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoAccount.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.kakao.response; +package sopt.org.umbba.external.client.auth.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserProfile.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserProfile.java similarity index 87% rename from src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserProfile.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserProfile.java index 9bcdd3ff..570db947 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserProfile.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserProfile.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.kakao.response; +package sopt.org.umbba.external.client.auth.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserResponse.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserResponse.java similarity index 89% rename from src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserResponse.java rename to umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserResponse.java index c1ee9438..858ca383 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/response/KakaoUserResponse.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserResponse.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.social.kakao.response; +package sopt.org.umbba.external.client.auth.kakao.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; From 0357a5eee30f9da62d0e43db3236845f56baf61d Mon Sep 17 00:00:00 2001 From: jun02160 Date: Tue, 8 Aug 2023 21:04:40 +0900 Subject: [PATCH 04/27] =?UTF-8?q?[REFACTOR]=20domain=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=20=EB=B6=84=EB=A6=AC=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/umbba/domain/config/jpa/JpaConfig.java | 14 ++++++++++++++ .../domain/domain/common}/AuditingTimeEntity.java | 4 ++-- .../domain/domain/parentchild}/Parentchild.java | 7 +++---- .../domain/parentchild}/ParentchildRelation.java | 6 ++---- .../repository/ParentchildRepository.java | 4 ++-- .../umbba/domain/domain/qna}/OnboardingAnswer.java | 4 +--- .../sopt/org/umbba/domain/domain/qna}/QnA.java | 4 ++-- .../org/umbba/domain/domain/qna}/Question.java | 4 ++-- .../umbba/domain/domain/qna}/QuestionSection.java | 2 +- .../org/umbba/domain/domain/qna}/QuestionType.java | 2 +- .../domain/qna/repository/QnARepository.java | 4 ++-- .../domain/qna/repository/QuestionRepository.java | 8 ++++---- .../umbba/domain/domain/user}/SocialPlatform.java | 4 +--- .../sopt/org/umbba/domain/domain/user}/User.java | 7 +++---- .../domain/user/repository/UserRepository.java | 8 ++++---- 15 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 umbba-domain/src/main/java/sopt/org/umbba/domain/config/jpa/JpaConfig.java rename {src/main/java/sopt/org/umbba/global/util => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/common}/AuditingTimeEntity.java (92%) rename {src/main/java/sopt/org/umbba/domain/parentchild/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild}/Parentchild.java (90%) rename {src/main/java/sopt/org/umbba/domain/parentchild/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild}/ParentchildRelation.java (93%) rename {src/main/java/sopt/org/umbba => umbba-domain/src/main/java/sopt/org/umbba/domain}/domain/parentchild/repository/ParentchildRepository.java (77%) rename {src/main/java/sopt/org/umbba/domain/qna/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna}/OnboardingAnswer.java (79%) rename {src/main/java/sopt/org/umbba/domain/qna/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna}/QnA.java (91%) rename {src/main/java/sopt/org/umbba/domain/qna/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna}/Question.java (87%) rename {src/main/java/sopt/org/umbba/domain/qna/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna}/QuestionSection.java (93%) rename {src/main/java/sopt/org/umbba/domain/qna/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna}/QuestionType.java (92%) rename {src/main/java/sopt/org/umbba => umbba-domain/src/main/java/sopt/org/umbba/domain}/domain/qna/repository/QnARepository.java (68%) rename {src/main/java/sopt/org/umbba => umbba-domain/src/main/java/sopt/org/umbba/domain}/domain/qna/repository/QuestionRepository.java (87%) rename {src/main/java/sopt/org/umbba/domain/user/social => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user}/SocialPlatform.java (80%) rename {src/main/java/sopt/org/umbba/domain/user/model => umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user}/User.java (94%) rename {src/main/java/sopt/org/umbba => umbba-domain/src/main/java/sopt/org/umbba/domain}/domain/user/repository/UserRepository.java (78%) diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/config/jpa/JpaConfig.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/config/jpa/JpaConfig.java new file mode 100644 index 00000000..0e0ab3c6 --- /dev/null +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/config/jpa/JpaConfig.java @@ -0,0 +1,14 @@ +package sopt.org.umbba.domain.config.jpa; + +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import sopt.org.umbba.domain.UmbbaDomainRoot; + +@Configuration +@EntityScan(basePackageClasses = {UmbbaDomainRoot.class}) +@EnableJpaRepositories(basePackageClasses = {UmbbaDomainRoot.class}) +@EnableJpaAuditing +public class JpaConfig { +} diff --git a/src/main/java/sopt/org/umbba/global/util/AuditingTimeEntity.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/common/AuditingTimeEntity.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/util/AuditingTimeEntity.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/common/AuditingTimeEntity.java index 347accae..0c085732 100644 --- a/src/main/java/sopt/org/umbba/global/util/AuditingTimeEntity.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/common/AuditingTimeEntity.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util; +package sopt.org.umbba.domain.domain.common; import lombok.Getter; import org.springframework.data.annotation.CreatedDate; @@ -19,4 +19,4 @@ public abstract class AuditingTimeEntity { @LastModifiedDate private LocalDateTime updatedAt; -} +} \ No newline at end of file diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/model/Parentchild.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java similarity index 90% rename from src/main/java/sopt/org/umbba/domain/parentchild/model/Parentchild.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java index 3bc83166..76345308 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/model/Parentchild.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java @@ -1,10 +1,9 @@ -package sopt.org.umbba.domain.parentchild.model; +package sopt.org.umbba.domain.domain.parentchild; import lombok.*; import lombok.extern.slf4j.Slf4j; -import sopt.org.umbba.domain.qna.model.OnboardingAnswer; -import sopt.org.umbba.domain.qna.model.QnA; -import sopt.org.umbba.global.util.AuditingTimeEntity; +import sopt.org.umbba.domain.domain.common.AuditingTimeEntity; +import sopt.org.umbba.domain.domain.qna.QnA; import javax.persistence.*; import java.time.LocalTime; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/model/ParentchildRelation.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java similarity index 93% rename from src/main/java/sopt/org/umbba/domain/parentchild/model/ParentchildRelation.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java index b420f265..f72673ac 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/model/ParentchildRelation.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java @@ -1,11 +1,9 @@ -package sopt.org.umbba.domain.parentchild.model; +package sopt.org.umbba.domain.domain.parentchild; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.domain.domain.user.User; import java.util.List; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/repository/ParentchildRepository.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/repository/ParentchildRepository.java similarity index 77% rename from src/main/java/sopt/org/umbba/domain/parentchild/repository/ParentchildRepository.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/repository/ParentchildRepository.java index d9623c81..f9efe00c 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/repository/ParentchildRepository.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/repository/ParentchildRepository.java @@ -1,7 +1,7 @@ -package sopt.org.umbba.domain.parentchild.repository; +package sopt.org.umbba.domain.domain.parentchild.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbba.domain.parentchild.model.Parentchild; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; import java.util.List; import java.util.Optional; diff --git a/src/main/java/sopt/org/umbba/domain/qna/model/OnboardingAnswer.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java similarity index 79% rename from src/main/java/sopt/org/umbba/domain/qna/model/OnboardingAnswer.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java index b31d7c0c..5e8bd74d 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/model/OnboardingAnswer.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java @@ -1,10 +1,8 @@ -package sopt.org.umbba.domain.qna.model; +package sopt.org.umbba.domain.domain.qna; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/src/main/java/sopt/org/umbba/domain/qna/model/QnA.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QnA.java similarity index 91% rename from src/main/java/sopt/org/umbba/domain/qna/model/QnA.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QnA.java index 855994ea..e689f60b 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/model/QnA.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QnA.java @@ -1,7 +1,7 @@ -package sopt.org.umbba.domain.qna.model; +package sopt.org.umbba.domain.domain.qna; import lombok.*; -import sopt.org.umbba.global.util.AuditingTimeEntity; +import sopt.org.umbba.domain.domain.common.AuditingTimeEntity; import javax.persistence.*; diff --git a/src/main/java/sopt/org/umbba/domain/qna/model/Question.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/Question.java similarity index 87% rename from src/main/java/sopt/org/umbba/domain/qna/model/Question.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/Question.java index 7b785328..703645df 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/model/Question.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/Question.java @@ -1,7 +1,7 @@ -package sopt.org.umbba.domain.qna.model; +package sopt.org.umbba.domain.domain.qna; import lombok.*; -import sopt.org.umbba.global.util.AuditingTimeEntity; +import sopt.org.umbba.domain.domain.common.AuditingTimeEntity; import javax.persistence.*; diff --git a/src/main/java/sopt/org/umbba/domain/qna/model/QuestionSection.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QuestionSection.java similarity index 93% rename from src/main/java/sopt/org/umbba/domain/qna/model/QuestionSection.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QuestionSection.java index e2aaedf4..38ee957d 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/model/QuestionSection.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QuestionSection.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.qna.model; +package sopt.org.umbba.domain.domain.qna; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbba/domain/qna/model/QuestionType.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QuestionType.java similarity index 92% rename from src/main/java/sopt/org/umbba/domain/qna/model/QuestionType.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QuestionType.java index 183eb903..461406c6 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/model/QuestionType.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/QuestionType.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.qna.model; +package sopt.org.umbba.domain.domain.qna; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbba/domain/qna/repository/QnARepository.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/repository/QnARepository.java similarity index 68% rename from src/main/java/sopt/org/umbba/domain/qna/repository/QnARepository.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/repository/QnARepository.java index efc10085..a90632b7 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/repository/QnARepository.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/repository/QnARepository.java @@ -1,7 +1,7 @@ -package sopt.org.umbba.domain.qna.repository; +package sopt.org.umbba.domain.domain.qna.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.domain.domain.qna.QnA; import java.util.Optional; diff --git a/src/main/java/sopt/org/umbba/domain/qna/repository/QuestionRepository.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/repository/QuestionRepository.java similarity index 87% rename from src/main/java/sopt/org/umbba/domain/qna/repository/QuestionRepository.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/repository/QuestionRepository.java index 6dda7764..1a9d7586 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/repository/QuestionRepository.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/repository/QuestionRepository.java @@ -1,9 +1,9 @@ -package sopt.org.umbba.domain.qna.repository; +package sopt.org.umbba.domain.domain.qna.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbba.domain.qna.model.Question; -import sopt.org.umbba.domain.qna.model.QuestionSection; -import sopt.org.umbba.domain.qna.model.QuestionType; +import sopt.org.umbba.domain.domain.qna.Question; +import sopt.org.umbba.domain.domain.qna.QuestionSection; +import sopt.org.umbba.domain.domain.qna.QuestionType; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/SocialPlatform.java similarity index 80% rename from src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/SocialPlatform.java index e50221bf..674f7dd2 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/SocialPlatform.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/SocialPlatform.java @@ -1,10 +1,8 @@ -package sopt.org.umbba.domain.user.social; +package sopt.org.umbba.domain.domain.user; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/src/main/java/sopt/org/umbba/domain/user/model/User.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/User.java similarity index 94% rename from src/main/java/sopt/org/umbba/domain/user/model/User.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/User.java index fc5eb9fd..6af074f2 100644 --- a/src/main/java/sopt/org/umbba/domain/user/model/User.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/User.java @@ -1,10 +1,9 @@ -package sopt.org.umbba.domain.user.model; +package sopt.org.umbba.domain.domain.user; import lombok.*; import lombok.extern.slf4j.Slf4j; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.user.social.SocialPlatform; -import sopt.org.umbba.global.util.AuditingTimeEntity; +import sopt.org.umbba.domain.domain.common.AuditingTimeEntity; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; import javax.persistence.*; import java.util.List; diff --git a/src/main/java/sopt/org/umbba/domain/user/repository/UserRepository.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/repository/UserRepository.java similarity index 78% rename from src/main/java/sopt/org/umbba/domain/user/repository/UserRepository.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/repository/UserRepository.java index 1da2a7df..cb6ecdc7 100644 --- a/src/main/java/sopt/org/umbba/domain/user/repository/UserRepository.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/repository/UserRepository.java @@ -1,9 +1,9 @@ -package sopt.org.umbba.domain.user.repository; +package sopt.org.umbba.domain.domain.user.repository; import org.springframework.data.repository.Repository; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.social.SocialPlatform; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.user.SocialPlatform; +import sopt.org.umbba.domain.domain.user.User; import java.util.List; import java.util.Optional; From 17814d70dbc8bfb115f5518c44061c439c372fe6 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Tue, 8 Aug 2023 21:10:53 +0900 Subject: [PATCH 05/27] [MERGE] merge conflict solve --- umbba-domain/build.gradle | 2 ++ .../sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java | 4 +++- .../sopt/org/umbba/domain/domain/user/SocialPlatform.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/umbba-domain/build.gradle b/umbba-domain/build.gradle index 5d917457..abcaf0bc 100644 --- a/umbba-domain/build.gradle +++ b/umbba-domain/build.gradle @@ -2,6 +2,8 @@ bootJar { enabled = false } jar { enabled = true } dependencies { + implementation project(path: ':umbba-common') + // JPA & Database api "org.springframework.boot:spring-boot-starter-data-jpa" implementation 'mysql:mysql-connector-java:8.0.32' diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java index 5e8bd74d..f2a6026d 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java @@ -3,6 +3,8 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) @@ -20,7 +22,7 @@ public static OnboardingAnswer of(String value) { return answer; } } - throw new CustomException(ErrorType.INVALID_ONBOARDING_ANSWER); + throw new CustomException(ErroType.INVALID_ONBOARDING_ANSWER); } } diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/SocialPlatform.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/SocialPlatform.java index 674f7dd2..f1503589 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/SocialPlatform.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/user/SocialPlatform.java @@ -3,6 +3,8 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) From d2e3f874bd1be19f2ce0e60a1d4e72c6cb4c413b Mon Sep 17 00:00:00 2001 From: jun02160 Date: Tue, 8 Aug 2023 21:51:04 +0900 Subject: [PATCH 06/27] =?UTF-8?q?[REFACTOR]=20Notification=20=EC=84=9C?= =?UTF-8?q?=EB=B2=84=20=EB=A1=9C=EC=A7=81=20=EB=B6=84=EB=A6=AC=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/domain/qna/OnboardingAnswer.java | 2 +- umbba-notification/.gitignore | 42 ----------- .../notification/config/fcm}/FCMConfig.java | 8 +- .../config/scheduler}/ScheduleConfig.java | 4 +- .../notification/config/sqs/SqsConfig.java | 34 +++++++++ .../controller/fcm}/FCMController.java | 13 ++-- .../controller/fcm}/dto/FCMMessage.java | 2 +- .../fcm}/dto/FCMPushRequestDto.java | 2 +- .../controller/fcm}/dto/PushMessage.java | 2 +- .../slack/SlackTestController.java | 4 +- .../notification/service}/fcm/FCMService.java | 23 +++--- .../service/scheduler}/FCMScheduler.java | 13 ++-- .../notification/service}/slack/SlackApi.java | 2 +- .../src/main/resources/application.yaml | 73 +++++++++++++++++++ 14 files changed, 144 insertions(+), 80 deletions(-) delete mode 100644 umbba-notification/.gitignore rename {src/main/java/sopt/org/umbba/global/config => umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm}/FCMConfig.java (93%) rename {src/main/java/sopt/org/umbba/global/config => umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler}/ScheduleConfig.java (92%) create mode 100644 umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/SqsConfig.java rename {src/main/java/sopt/org/umbba/global/util/fcm/controller => umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm}/FCMController.java (83%) rename {src/main/java/sopt/org/umbba/global/util/fcm/controller => umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm}/dto/FCMMessage.java (97%) rename {src/main/java/sopt/org/umbba/global/util/fcm/controller => umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm}/dto/FCMPushRequestDto.java (96%) rename {src/main/java/sopt/org/umbba/global/util/fcm/controller => umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm}/dto/PushMessage.java (92%) rename {src/main/java/sopt/org/umbba/global/util => umbba-notification/src/main/java/sopt/org/umbba/notification/controller}/slack/SlackTestController.java (84%) rename {src/main/java/sopt/org/umbba/global/util => umbba-notification/src/main/java/sopt/org/umbba/notification/service}/fcm/FCMService.java (95%) rename {src/main/java/sopt/org/umbba/global/util/fcm => umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler}/FCMScheduler.java (85%) rename {src/main/java/sopt/org/umbba/global/util => umbba-notification/src/main/java/sopt/org/umbba/notification/service}/slack/SlackApi.java (98%) create mode 100644 umbba-notification/src/main/resources/application.yaml diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java index f2a6026d..c817bf19 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java @@ -22,7 +22,7 @@ public static OnboardingAnswer of(String value) { return answer; } } - throw new CustomException(ErroType.INVALID_ONBOARDING_ANSWER); + throw new CustomException(ErrorType.INVALID_ONBOARDING_ANSWER); } } diff --git a/umbba-notification/.gitignore b/umbba-notification/.gitignore deleted file mode 100644 index b63da455..00000000 --- a/umbba-notification/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -.gradle -build/ -!gradle/wrapper/gradle-wrapper.jar -!**/src/main/**/build/ -!**/src/test/**/build/ - -### IntelliJ IDEA ### -.idea/modules.xml -.idea/jarRepositories.xml -.idea/compiler.xml -.idea/libraries/ -*.iws -*.iml -*.ipr -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/src/main/java/sopt/org/umbba/global/config/FCMConfig.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java similarity index 93% rename from src/main/java/sopt/org/umbba/global/config/FCMConfig.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java index e354a30c..ec52548c 100644 --- a/src/main/java/sopt/org/umbba/global/config/FCMConfig.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config; +package sopt.org.umbba.notification.config.fcm; import com.google.auth.oauth2.GoogleCredentials; import com.google.firebase.FirebaseApp; @@ -9,9 +9,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; -import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto; import javax.annotation.PostConstruct; import java.io.IOException; diff --git a/src/main/java/sopt/org/umbba/global/config/ScheduleConfig.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler/ScheduleConfig.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/config/ScheduleConfig.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler/ScheduleConfig.java index 9ee77f75..b9c7d393 100644 --- a/src/main/java/sopt/org/umbba/global/config/ScheduleConfig.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler/ScheduleConfig.java @@ -1,10 +1,10 @@ -package sopt.org.umbba.global.config; +package sopt.org.umbba.notification.config.scheduler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; -import sopt.org.umbba.global.util.fcm.FCMService; +import sopt.org.umbba.notification.service.fcm.FCMService; import java.util.concurrent.ThreadPoolExecutor; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/SqsConfig.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/SqsConfig.java new file mode 100644 index 00000000..8aa52b01 --- /dev/null +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/SqsConfig.java @@ -0,0 +1,34 @@ +package sopt.org.umbba.notification.config.sqs; + +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.sqs.AmazonSQSAsync; +import com.amazonaws.services.sqs.AmazonSQSAsyncClient; +import com.amazonaws.services.sqs.AmazonSQSAsyncClientBuilder; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +@Configuration +public class SqsConfig { + + @Value("${cloud.aws.credentials.accessKey}") + private String AWS_ACCESS_KEY; + + @Value("${cloud.aws.credentials.secretKey}") + private String AWS_SECRET_KEY; + + @Value("${cloud.aws.region.static}") + private String AWS_REGION; + + @Primary + @Bean + public AmazonSQSAsync amazonSQSAsync() { + BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY); + return AmazonSQSAsyncClientBuilder.standard() + .withRegion(AWS_REGION) + .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials)) + .build(); + } +} diff --git a/src/main/java/sopt/org/umbba/global/util/fcm/controller/FCMController.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/FCMController.java similarity index 83% rename from src/main/java/sopt/org/umbba/global/util/fcm/controller/FCMController.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/FCMController.java index 70ea888a..bb10ab27 100644 --- a/src/main/java/sopt/org/umbba/global/util/fcm/controller/FCMController.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/FCMController.java @@ -1,14 +1,13 @@ -package sopt.org.umbba.global.util.fcm.controller; +package sopt.org.umbba.notification.controller.fcm; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbba.global.common.dto.ApiResponse; -import sopt.org.umbba.global.config.jwt.JwtProvider; -import sopt.org.umbba.global.exception.SuccessType; -import sopt.org.umbba.global.util.fcm.FCMScheduler; -import sopt.org.umbba.global.util.fcm.FCMService; -import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; +import sopt.org.umbba.common.exception.SuccessType; +import sopt.org.umbba.common.exception.dto.ApiResponse; +import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto; +import sopt.org.umbba.notification.service.fcm.FCMService; +import sopt.org.umbba.notification.service.scheduler.FCMScheduler; import java.io.IOException; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMMessage.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMMessage.java similarity index 97% rename from src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMMessage.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMMessage.java index f52de117..334fb21b 100644 --- a/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMMessage.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMMessage.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util.fcm.controller.dto; +package sopt.org.umbba.notification.controller.fcm.dto; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMPushRequestDto.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMPushRequestDto.java similarity index 96% rename from src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMPushRequestDto.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMPushRequestDto.java index 784524db..98fd18a5 100644 --- a/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/FCMPushRequestDto.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMPushRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util.fcm.controller.dto; +package sopt.org.umbba.notification.controller.fcm.dto; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.*; diff --git a/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/PushMessage.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/PushMessage.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/PushMessage.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/PushMessage.java index 2eb6f0b2..1c23b3c6 100644 --- a/src/main/java/sopt/org/umbba/global/util/fcm/controller/dto/PushMessage.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/PushMessage.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util.fcm.controller.dto; +package sopt.org.umbba.notification.controller.fcm.dto; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbba/global/util/slack/SlackTestController.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/slack/SlackTestController.java similarity index 84% rename from src/main/java/sopt/org/umbba/global/util/slack/SlackTestController.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/controller/slack/SlackTestController.java index 02c75474..1ff4d596 100644 --- a/src/main/java/sopt/org/umbba/global/util/slack/SlackTestController.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/slack/SlackTestController.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util.slack; +package sopt.org.umbba.notification.controller.slack; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import sopt.org.umbba.global.common.dto.ApiResponse; +import sopt.org.umbba.common.exception.dto.ApiResponse; @Slf4j @RestController diff --git a/src/main/java/sopt/org/umbba/global/util/fcm/FCMService.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java similarity index 95% rename from src/main/java/sopt/org/umbba/global/util/fcm/FCMService.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java index 26fe778f..2c715d99 100644 --- a/src/main/java/sopt/org/umbba/global/util/fcm/FCMService.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util.fcm; +package sopt.org.umbba.notification.service.fcm; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -19,17 +19,16 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.DefaultTransactionDefinition; -import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository; -import sopt.org.umbba.domain.qna.model.QnA; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.repository.UserRepository; -import sopt.org.umbba.domain.user.social.SocialPlatform; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; -import sopt.org.umbba.global.util.fcm.controller.dto.FCMMessage; -import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.parentchild.repository.ParentchildRepository; +import sopt.org.umbba.domain.domain.qna.QnA; +import sopt.org.umbba.domain.domain.user.SocialPlatform; +import sopt.org.umbba.domain.domain.user.User; +import sopt.org.umbba.domain.domain.user.repository.UserRepository; +import sopt.org.umbba.notification.controller.fcm.dto.FCMMessage; +import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; diff --git a/src/main/java/sopt/org/umbba/global/util/fcm/FCMScheduler.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler/FCMScheduler.java similarity index 85% rename from src/main/java/sopt/org/umbba/global/util/fcm/FCMScheduler.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler/FCMScheduler.java index db32c876..2d1fc040 100644 --- a/src/main/java/sopt/org/umbba/global/util/fcm/FCMScheduler.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler/FCMScheduler.java @@ -1,14 +1,15 @@ -package sopt.org.umbba.global.util.fcm; +package sopt.org.umbba.notification.service.scheduler; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.repository.UserRepository; -import sopt.org.umbba.domain.user.social.SocialPlatform; + +import sopt.org.umbba.domain.domain.parentchild.repository.ParentchildRepository; +import sopt.org.umbba.domain.domain.user.SocialPlatform; +import sopt.org.umbba.domain.domain.user.User; +import sopt.org.umbba.domain.domain.user.repository.UserRepository; +import sopt.org.umbba.notification.service.fcm.FCMService; import java.util.List; diff --git a/src/main/java/sopt/org/umbba/global/util/slack/SlackApi.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/slack/SlackApi.java similarity index 98% rename from src/main/java/sopt/org/umbba/global/util/slack/SlackApi.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/service/slack/SlackApi.java index ce9cefe0..3f139dc2 100644 --- a/src/main/java/sopt/org/umbba/global/util/slack/SlackApi.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/slack/SlackApi.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util.slack; +package sopt.org.umbba.notification.service.slack; import com.slack.api.Slack; import com.slack.api.model.block.Blocks; diff --git a/umbba-notification/src/main/resources/application.yaml b/umbba-notification/src/main/resources/application.yaml new file mode 100644 index 00000000..acf23877 --- /dev/null +++ b/umbba-notification/src/main/resources/application.yaml @@ -0,0 +1,73 @@ +cloud: + aws: + credentials: + accessKey: ${cloud-access} + secretKey: ${cloud-secret} + region: + static: ${cloud-region} + s3: + bucket: ${bucket-name} + stack: + auto: false + sqs: + notification: + name: ${AWS_SQS_NOTIFICATION_NAME_DEV} + url: ${AWS_SQS_NOTIFICATION_URL_DEV} + api: + name: ${AWS_SQS_API_NAME_DEV} + url: ${AWS_SQS_API_URL_DEV} + + +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${db-url} + username: ${db-user} + password: ${db-pwd} + jpa: + show-sql: false + hibernate: + ddl-auto: update + ejb: + naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + properties: + hibernate: + format_sql: false + +kakao: + client-id: ${kakao-id} + authorization-grant-type: authorization_code + redirect-uri: ${kakao-redirect} + +apple: + iss: ${apple-iss} + client-id: ${apple-id} +# nonce: ${apple-nonce} + +jwt: + secret: ${jwt-secret} + +slack: + webhook: + url: ${slack-url} + +fcm: + key: + path: ${fcm-json-path} + scope: ${fcm-scope} + # firebase-create-scoped: "https://www.googleapis.com/auth/firebase.messaging" + api: + url: ${fcm-api-url} + topic: + "qna_notification" + +logging: + level: + org: + hibernate: + type: + descriptor: + sql: debug + +server: + port: 9091 From a863c51e1fad663ade8cf40f659ffad22ffed7d5 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 22:07:43 +0900 Subject: [PATCH 07/27] =?UTF-8?q?[REFACTOR]=20api=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umbba-api/build.gradle | 12 ++++-- .../org/umbba/api}/config/SecurityConfig.java | 6 +-- .../CustomJwtAuthenticationEntryPoint.java | 6 +-- .../config/auth/JwtAuthenticationFilter.java | 6 +-- .../api}/config/auth/UserAuthentication.java | 3 +- .../umbba/api}/config/jwt/JwtProvider.java | 10 ++--- .../api}/config/jwt/JwtValidationType.java | 2 +- .../org/umbba/api}/config/jwt/TokenDto.java | 2 +- .../advice/ControllerExceptionAdvice.java | 16 +++---- .../controller/health}/DemoController.java | 8 ++-- .../health}/ServerProfileController.java | 2 +- .../parentchild}/ParentchildController.java | 25 +++++------ .../dto/request/InviteCodeRequestDto.java | 2 +- .../request/OnboardingInviteRequestDto.java | 4 +- .../request/OnboardingReceiveRequestDto.java | 4 +- .../dto/response/InviteResultResponseDto.java | 8 ++-- .../response/OnboardingInviteResponseDto.java | 8 ++-- .../OnboardingReceiveResponseDto.java | 8 ++-- .../api/controller/qna}/QnAController.java | 14 +++---- .../dto/request/TodayAnswerRequestDto.java | 2 +- .../response/GetInvitationResponseDto.java | 2 +- .../dto/response/GetMainViewResponseDto.java | 4 +- .../qna}/dto/response/QnAListResponseDto.java | 2 +- .../dto/response/SingleQnAResponseDto.java | 8 ++-- .../dto/response/TodayQnAResponseDto.java | 8 ++-- .../api/controller/user}/AuthController.java | 20 ++++----- .../user}/dto/request/RefreshRequestDto.java | 2 +- .../dto/request/SocialLoginRequestDto.java | 2 +- .../user}/dto/request/UserInfoDto.java | 4 +- .../dto/response/UserLoginResponseDto.java | 8 ++-- .../parentchild}/ParentchildService.java | 33 +++++++-------- .../umbba/api/service/qna}/QnAService.java | 42 ++++++++++--------- .../umbba/api/service/user}/AuthService.java | 29 +++++++------ .../user/social/apple/AppleLoginService.java | 17 ++++---- .../apple/verify/AppleClaimsValidator.java | 2 +- .../social/apple/verify/AppleJwtParser.java | 6 +-- .../social/apple/verify/EncryptUtils.java | 7 ++-- .../apple/verify/PublicKeyGenerator.java | 6 +-- .../user/social/kakao/KakaoLoginService.java | 12 +++--- umbba-domain/build.gradle | 6 ++- .../parentchild/dao/ParentchildDao.java | 2 +- .../domain/domain/qna/OnboardingAnswer.java | 2 +- .../umbba/domain}/domain/qna/dao/QnADao.java | 2 +- .../domain/domain}/redis/RefreshToken.java | 2 +- .../domain/domain}/redis/TokenRepository.java | 2 +- 45 files changed, 190 insertions(+), 188 deletions(-) rename {src/main/java/sopt/org/umbba/global => umbba-api/src/main/java/sopt/org/umbba/api}/config/SecurityConfig.java (92%) rename {src/main/java/sopt/org/umbba/global => umbba-api/src/main/java/sopt/org/umbba/api}/config/auth/CustomJwtAuthenticationEntryPoint.java (88%) rename {src/main/java/sopt/org/umbba/global => umbba-api/src/main/java/sopt/org/umbba/api}/config/auth/JwtAuthenticationFilter.java (93%) rename {src/main/java/sopt/org/umbba/global => umbba-api/src/main/java/sopt/org/umbba/api}/config/auth/UserAuthentication.java (90%) rename {src/main/java/sopt/org/umbba/global => umbba-api/src/main/java/sopt/org/umbba/api}/config/jwt/JwtProvider.java (95%) rename {src/main/java/sopt/org/umbba/global => umbba-api/src/main/java/sopt/org/umbba/api}/config/jwt/JwtValidationType.java (93%) rename {src/main/java/sopt/org/umbba/global => umbba-api/src/main/java/sopt/org/umbba/api}/config/jwt/TokenDto.java (92%) rename {src/main/java/sopt/org/umbba/global/common => umbba-api/src/main/java/sopt/org/umbba/api/controller}/advice/ControllerExceptionAdvice.java (95%) rename {src/main/java/sopt/org/umbba/global/common => umbba-api/src/main/java/sopt/org/umbba/api/controller/health}/DemoController.java (87%) rename {src/main/java/sopt/org/umbba/global/util => umbba-api/src/main/java/sopt/org/umbba/api/controller/health}/ServerProfileController.java (92%) rename {src/main/java/sopt/org/umbba/domain/parentchild/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild}/ParentchildController.java (68%) rename {src/main/java/sopt/org/umbba/domain/parentchild/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild}/dto/request/InviteCodeRequestDto.java (91%) rename {src/main/java/sopt/org/umbba/domain/parentchild/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild}/dto/request/OnboardingInviteRequestDto.java (88%) rename {src/main/java/sopt/org/umbba/domain/parentchild/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild}/dto/request/OnboardingReceiveRequestDto.java (82%) rename {src/main/java/sopt/org/umbba/domain/parentchild/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild}/dto/response/InviteResultResponseDto.java (86%) rename {src/main/java/sopt/org/umbba/domain/parentchild/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild}/dto/response/OnboardingInviteResponseDto.java (81%) rename {src/main/java/sopt/org/umbba/domain/parentchild/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild}/dto/response/OnboardingReceiveResponseDto.java (79%) rename {src/main/java/sopt/org/umbba/domain/qna/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/qna}/QnAController.java (85%) rename {src/main/java/sopt/org/umbba/domain/qna/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/qna}/dto/request/TodayAnswerRequestDto.java (91%) rename {src/main/java/sopt/org/umbba/domain/qna/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/qna}/dto/response/GetInvitationResponseDto.java (96%) rename {src/main/java/sopt/org/umbba/domain/qna/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/qna}/dto/response/GetMainViewResponseDto.java (86%) rename {src/main/java/sopt/org/umbba/domain/qna/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/qna}/dto/response/QnAListResponseDto.java (86%) rename {src/main/java/sopt/org/umbba/domain/qna/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/qna}/dto/response/SingleQnAResponseDto.java (90%) rename {src/main/java/sopt/org/umbba/domain/qna/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/qna}/dto/response/TodayQnAResponseDto.java (92%) rename {src/main/java/sopt/org/umbba/domain/user/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/user}/AuthController.java (77%) rename {src/main/java/sopt/org/umbba/domain/user/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/user}/dto/request/RefreshRequestDto.java (86%) rename {src/main/java/sopt/org/umbba/domain/user/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/user}/dto/request/SocialLoginRequestDto.java (88%) rename {src/main/java/sopt/org/umbba/domain/user/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/user}/dto/request/UserInfoDto.java (90%) rename {src/main/java/sopt/org/umbba/domain/user/controller => umbba-api/src/main/java/sopt/org/umbba/api/controller/user}/dto/response/UserLoginResponseDto.java (88%) rename {src/main/java/sopt/org/umbba/domain/parentchild/service => umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild}/ParentchildService.java (83%) rename {src/main/java/sopt/org/umbba/domain/qna/service => umbba-api/src/main/java/sopt/org/umbba/api/service/qna}/QnAService.java (92%) rename {src/main/java/sopt/org/umbba/domain/user/service => umbba-api/src/main/java/sopt/org/umbba/api/service/user}/AuthService.java (84%) rename {src/main/java/sopt/org/umbba/domain => umbba-api/src/main/java/sopt/org/umbba/api/service}/user/social/apple/AppleLoginService.java (67%) rename {src/main/java/sopt/org/umbba/domain => umbba-api/src/main/java/sopt/org/umbba/api/service}/user/social/apple/verify/AppleClaimsValidator.java (93%) rename {src/main/java/sopt/org/umbba/domain => umbba-api/src/main/java/sopt/org/umbba/api/service}/user/social/apple/verify/AppleJwtParser.java (90%) rename {src/main/java/sopt/org/umbba/domain => umbba-api/src/main/java/sopt/org/umbba/api/service}/user/social/apple/verify/EncryptUtils.java (80%) rename {src/main/java/sopt/org/umbba/domain => umbba-api/src/main/java/sopt/org/umbba/api/service}/user/social/apple/verify/PublicKeyGenerator.java (91%) rename {src/main/java/sopt/org/umbba/domain => umbba-api/src/main/java/sopt/org/umbba/api/service}/user/social/kakao/KakaoLoginService.java (84%) rename {src/main/java/sopt/org/umbba => umbba-domain/src/main/java/sopt/org/umbba/domain}/domain/parentchild/dao/ParentchildDao.java (97%) rename {src/main/java/sopt/org/umbba => umbba-domain/src/main/java/sopt/org/umbba/domain}/domain/qna/dao/QnADao.java (96%) rename {src/main/java/sopt/org/umbba/global/config/jwt => umbba-domain/src/main/java/sopt/org/umbba/domain/domain}/redis/RefreshToken.java (92%) rename {src/main/java/sopt/org/umbba/global/config/jwt => umbba-domain/src/main/java/sopt/org/umbba/domain/domain}/redis/TokenRepository.java (78%) diff --git a/umbba-api/build.gradle b/umbba-api/build.gradle index 5e4fdc45..66ff93ef 100644 --- a/umbba-api/build.gradle +++ b/umbba-api/build.gradle @@ -6,10 +6,6 @@ dependencies { // spring mvc implementation 'org.springframework.boot:spring-boot-starter-web' - // redis - implementation "org.springframework.boot:spring-boot-starter-data-redis" - implementation "org.springframework.session:spring-session-data-redis" - // swagger // implementation 'org.springdoc:springdoc-openapi-ui:1.5.4' @@ -20,9 +16,17 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.security:spring-security-test' + // jwt + implementation group: "io.jsonwebtoken", name: "jjwt-api", version: "0.11.2" + implementation group: "io.jsonwebtoken", name: "jjwt-impl", version: "0.11.2" + implementation group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2" + // random String implementation 'org.apache.commons:commons-lang3' + // for FeignException + implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.7' + // s3 // implementation "org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE" } \ No newline at end of file diff --git a/src/main/java/sopt/org/umbba/global/config/SecurityConfig.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/SecurityConfig.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/config/SecurityConfig.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/SecurityConfig.java index 3fcb1904..76254bd2 100644 --- a/src/main/java/sopt/org/umbba/global/config/SecurityConfig.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/SecurityConfig.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config; +package sopt.org.umbba.api.config; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; @@ -8,8 +8,8 @@ import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import sopt.org.umbba.global.config.auth.CustomJwtAuthenticationEntryPoint; -import sopt.org.umbba.global.config.auth.JwtAuthenticationFilter; +import sopt.org.umbba.api.config.auth.CustomJwtAuthenticationEntryPoint; +import sopt.org.umbba.api.config.auth.JwtAuthenticationFilter; @Configuration @EnableWebSecurity diff --git a/src/main/java/sopt/org/umbba/global/config/auth/CustomJwtAuthenticationEntryPoint.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/auth/CustomJwtAuthenticationEntryPoint.java similarity index 88% rename from src/main/java/sopt/org/umbba/global/config/auth/CustomJwtAuthenticationEntryPoint.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/auth/CustomJwtAuthenticationEntryPoint.java index c03827fa..39a23c4c 100644 --- a/src/main/java/sopt/org/umbba/global/config/auth/CustomJwtAuthenticationEntryPoint.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/auth/CustomJwtAuthenticationEntryPoint.java @@ -1,12 +1,12 @@ -package sopt.org.umbba.global.config.auth; +package sopt.org.umbba.api.config.auth; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.http.MediaType; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.stereotype.Component; -import sopt.org.umbba.global.common.dto.ApiResponse; -import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.dto.ApiResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/src/main/java/sopt/org/umbba/global/config/auth/JwtAuthenticationFilter.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/auth/JwtAuthenticationFilter.java similarity index 93% rename from src/main/java/sopt/org/umbba/global/config/auth/JwtAuthenticationFilter.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/auth/JwtAuthenticationFilter.java index 3f3a0429..99951680 100644 --- a/src/main/java/sopt/org/umbba/global/config/auth/JwtAuthenticationFilter.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/auth/JwtAuthenticationFilter.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config.auth; +package sopt.org.umbba.api.config.auth; import lombok.NonNull; import lombok.RequiredArgsConstructor; @@ -8,8 +8,8 @@ import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import org.springframework.web.filter.OncePerRequestFilter; -import sopt.org.umbba.global.config.jwt.JwtValidationType; -import sopt.org.umbba.global.config.jwt.JwtProvider; +import sopt.org.umbba.api.config.jwt.JwtProvider; +import sopt.org.umbba.api.config.jwt.JwtValidationType; import javax.servlet.FilterChain; import javax.servlet.ServletException; diff --git a/src/main/java/sopt/org/umbba/global/config/auth/UserAuthentication.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/auth/UserAuthentication.java similarity index 90% rename from src/main/java/sopt/org/umbba/global/config/auth/UserAuthentication.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/auth/UserAuthentication.java index 1b5dbd26..f0f7083c 100644 --- a/src/main/java/sopt/org/umbba/global/config/auth/UserAuthentication.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/auth/UserAuthentication.java @@ -1,5 +1,4 @@ -package sopt.org.umbba.global.config.auth; - +package sopt.org.umbba.api.config.auth; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; diff --git a/src/main/java/sopt/org/umbba/global/config/jwt/JwtProvider.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtProvider.java similarity index 95% rename from src/main/java/sopt/org/umbba/global/config/jwt/JwtProvider.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtProvider.java index a6ff86b5..bea4ce2c 100644 --- a/src/main/java/sopt/org/umbba/global/config/jwt/JwtProvider.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtProvider.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config.jwt; +package sopt.org.umbba.api.config.jwt; import io.jsonwebtoken.*; @@ -8,10 +8,10 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; -import sopt.org.umbba.global.config.jwt.redis.RefreshToken; -import sopt.org.umbba.global.config.jwt.redis.TokenRepository; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.domain.domain.redis.RefreshToken; +import sopt.org.umbba.domain.domain.redis.TokenRepository; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; import javax.annotation.PostConstruct; import javax.crypto.SecretKey; diff --git a/src/main/java/sopt/org/umbba/global/config/jwt/JwtValidationType.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtValidationType.java similarity index 93% rename from src/main/java/sopt/org/umbba/global/config/jwt/JwtValidationType.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtValidationType.java index c8b3ec85..dd7cc444 100644 --- a/src/main/java/sopt/org/umbba/global/config/jwt/JwtValidationType.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtValidationType.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config.jwt; +package sopt.org.umbba.api.config.jwt; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/sopt/org/umbba/global/config/jwt/TokenDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/TokenDto.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/config/jwt/TokenDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/TokenDto.java index 6e54c174..4c456b26 100644 --- a/src/main/java/sopt/org/umbba/global/config/jwt/TokenDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/TokenDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config.jwt; +package sopt.org.umbba.api.config.jwt; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/global/common/advice/ControllerExceptionAdvice.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java similarity index 95% rename from src/main/java/sopt/org/umbba/global/common/advice/ControllerExceptionAdvice.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java index 897d5fbb..57e57ec4 100644 --- a/src/main/java/sopt/org/umbba/global/common/advice/ControllerExceptionAdvice.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.common.advice; +package sopt.org.umbba.api.controller.advice; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -15,10 +15,9 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; -import sopt.org.umbba.global.common.dto.ApiResponse; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; -import sopt.org.umbba.global.util.slack.SlackApi; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.dto.ApiResponse; +import sopt.org.umbba.common.exception.model.CustomException; import javax.servlet.http.HttpServletRequest; import javax.validation.UnexpectedTypeException; @@ -32,7 +31,7 @@ @RequiredArgsConstructor public class ControllerExceptionAdvice { - private final SlackApi slackApi; +// private final SlackApi slackApi; /** * 400 BAD_REQUEST @@ -87,15 +86,13 @@ protected ApiResponse handlerHttpRequestMethodNotSupportedException(fina } - - /** * 500 INTERNEL_SERVER // TODO 서비스 단에서 예외가 꼼꼼하게 처리된 상태에서 500 에러를 가장 마지막에 던지도록 처리 */ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(Exception.class) protected ApiResponse handleException(final Exception e, final HttpServletRequest request) throws IOException { - slackApi.sendAlert(e, request); +// slackApi.sendAlert(e, request); TODO ⭐️이 지점에서 SQS에 넣어야함 log.error("Unexpected exception occurred: {}", e.getMessage(), e); @@ -176,7 +173,6 @@ public ApiResponse handlerNullPointerException(final NullPointerExcep }*/ - /** * CUSTOM_ERROR */ diff --git a/src/main/java/sopt/org/umbba/global/common/DemoController.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/DemoController.java similarity index 87% rename from src/main/java/sopt/org/umbba/global/common/DemoController.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/health/DemoController.java index 62f5ab93..e721786b 100644 --- a/src/main/java/sopt/org/umbba/global/common/DemoController.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/DemoController.java @@ -1,11 +1,11 @@ -package sopt.org.umbba.global.common; +package sopt.org.umbba.api.controller.health; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbba.domain.qna.service.QnAService; -import sopt.org.umbba.global.common.dto.ApiResponse; -import sopt.org.umbba.global.exception.SuccessType; +import sopt.org.umbba.api.service.qna.QnAService; +import sopt.org.umbba.common.exception.SuccessType; +import sopt.org.umbba.common.exception.dto.ApiResponse; @RestController @RequiredArgsConstructor diff --git a/src/main/java/sopt/org/umbba/global/util/ServerProfileController.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/ServerProfileController.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/util/ServerProfileController.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/health/ServerProfileController.java index 81d7ab48..b0f7dc9f 100644 --- a/src/main/java/sopt/org/umbba/global/util/ServerProfileController.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/ServerProfileController.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.util; +package sopt.org.umbba.api.controller.health; import lombok.RequiredArgsConstructor; import org.springframework.core.env.Environment; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/controller/ParentchildController.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/ParentchildController.java similarity index 68% rename from src/main/java/sopt/org/umbba/domain/parentchild/controller/ParentchildController.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/ParentchildController.java index 85330179..593963d9 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/controller/ParentchildController.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/ParentchildController.java @@ -1,20 +1,21 @@ -package sopt.org.umbba.domain.parentchild.controller; +package sopt.org.umbba.api.controller.parentchild; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbba.domain.parentchild.controller.dto.request.InviteCodeRequestDto; -import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingInviteRequestDto; -import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingReceiveRequestDto; -import sopt.org.umbba.domain.parentchild.controller.dto.response.InviteResultResponseDto; -import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingInviteResponseDto; -import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingReceiveResponseDto; -import sopt.org.umbba.domain.parentchild.service.ParentchildService; -import sopt.org.umbba.domain.qna.service.QnAService; -import sopt.org.umbba.global.common.dto.ApiResponse; -import sopt.org.umbba.global.config.jwt.JwtProvider; -import sopt.org.umbba.global.exception.SuccessType; +import sopt.org.umbba.api.config.jwt.JwtProvider; +import sopt.org.umbba.api.controller.parentchild.dto.request.InviteCodeRequestDto; +import sopt.org.umbba.api.controller.parentchild.dto.request.OnboardingInviteRequestDto; +import sopt.org.umbba.api.controller.parentchild.dto.request.OnboardingReceiveRequestDto; +import sopt.org.umbba.api.controller.parentchild.dto.response.InviteResultResponseDto; +import sopt.org.umbba.api.controller.parentchild.dto.response.OnboardingInviteResponseDto; +import sopt.org.umbba.api.controller.parentchild.dto.response.OnboardingReceiveResponseDto; +import sopt.org.umbba.api.service.parentchild.ParentchildService; +import sopt.org.umbba.api.service.qna.QnAService; +import sopt.org.umbba.common.exception.SuccessType; +import sopt.org.umbba.common.exception.dto.ApiResponse; + import javax.validation.Valid; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/InviteCodeRequestDto.java similarity index 91% rename from src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/InviteCodeRequestDto.java index a32930fb..826589af 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/InviteCodeRequestDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/InviteCodeRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.parentchild.controller.dto.request; +package sopt.org.umbba.api.controller.parentchild.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/OnboardingInviteRequestDto.java similarity index 88% rename from src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/OnboardingInviteRequestDto.java index d68aeef9..82d8ff3e 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/OnboardingInviteRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.parentchild.controller.dto.request; +package sopt.org.umbba.api.controller.parentchild.dto.request; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; @@ -8,7 +8,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; -import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; +import sopt.org.umbba.api.controller.user.dto.request.UserInfoDto; import javax.validation.Valid; import javax.validation.constraints.NotEmpty; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/OnboardingReceiveRequestDto.java similarity index 82% rename from src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/OnboardingReceiveRequestDto.java index c8fd4de8..7eb6d0fa 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/request/OnboardingReceiveRequestDto.java @@ -1,11 +1,11 @@ -package sopt.org.umbba.domain.parentchild.controller.dto.request; +package sopt.org.umbba.api.controller.parentchild.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; -import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; +import sopt.org.umbba.api.controller.user.dto.request.UserInfoDto; import javax.validation.Valid; import javax.validation.constraints.NotEmpty; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/InviteResultResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/InviteResultResponseDto.java similarity index 86% rename from src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/InviteResultResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/InviteResultResponseDto.java index 8417d6fd..60b5cbf2 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/InviteResultResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/InviteResultResponseDto.java @@ -1,13 +1,13 @@ -package sopt.org.umbba.domain.parentchild.controller.dto.response; +package sopt.org.umbba.api.controller.parentchild.dto.response; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; -import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.api.controller.user.dto.request.UserInfoDto; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.user.User; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/OnboardingInviteResponseDto.java similarity index 81% rename from src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/OnboardingInviteResponseDto.java index e0c1f6ea..bce5d63f 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/OnboardingInviteResponseDto.java @@ -1,13 +1,13 @@ -package sopt.org.umbba.domain.parentchild.controller.dto.response; +package sopt.org.umbba.api.controller.parentchild.dto.response; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; -import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.api.controller.user.dto.request.UserInfoDto; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.user.User; import java.time.LocalTime; diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/OnboardingReceiveResponseDto.java similarity index 79% rename from src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/OnboardingReceiveResponseDto.java index 00c01fa1..141192ab 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/parentchild/dto/response/OnboardingReceiveResponseDto.java @@ -1,13 +1,13 @@ -package sopt.org.umbba.domain.parentchild.controller.dto.response; +package sopt.org.umbba.api.controller.parentchild.dto.response; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.user.controller.dto.request.UserInfoDto; -import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.api.controller.user.dto.request.UserInfoDto; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.user.User; import java.time.LocalTime; import java.util.List; diff --git a/src/main/java/sopt/org/umbba/domain/qna/controller/QnAController.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/QnAController.java similarity index 85% rename from src/main/java/sopt/org/umbba/domain/qna/controller/QnAController.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/QnAController.java index 04aabdbe..37c910ec 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/controller/QnAController.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/QnAController.java @@ -1,14 +1,14 @@ -package sopt.org.umbba.domain.qna.controller; +package sopt.org.umbba.api.controller.qna; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbba.domain.qna.controller.dto.request.TodayAnswerRequestDto; -import sopt.org.umbba.domain.qna.controller.dto.response.*; -import sopt.org.umbba.domain.qna.service.QnAService; -import sopt.org.umbba.global.common.dto.ApiResponse; -import sopt.org.umbba.global.config.jwt.JwtProvider; -import sopt.org.umbba.global.exception.SuccessType; +import sopt.org.umbba.api.config.jwt.JwtProvider; +import sopt.org.umbba.api.controller.qna.dto.request.TodayAnswerRequestDto; +import sopt.org.umbba.api.controller.qna.dto.response.*; +import sopt.org.umbba.api.service.qna.QnAService; +import sopt.org.umbba.common.exception.SuccessType; +import sopt.org.umbba.common.exception.dto.ApiResponse; import javax.validation.Valid; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/request/TodayAnswerRequestDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/request/TodayAnswerRequestDto.java similarity index 91% rename from src/main/java/sopt/org/umbba/domain/qna/controller/dto/request/TodayAnswerRequestDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/request/TodayAnswerRequestDto.java index c97a9826..36eecdf2 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/request/TodayAnswerRequestDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/request/TodayAnswerRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.qna.controller.dto.request; +package sopt.org.umbba.api.controller.qna.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetInvitationResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/GetInvitationResponseDto.java similarity index 96% rename from src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetInvitationResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/GetInvitationResponseDto.java index 72bea792..5c61e0da 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetInvitationResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/GetInvitationResponseDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.qna.controller.dto.response; +package sopt.org.umbba.api.controller.qna.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetMainViewResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/GetMainViewResponseDto.java similarity index 86% rename from src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetMainViewResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/GetMainViewResponseDto.java index 6cf83fb6..bf00508a 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/GetMainViewResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/GetMainViewResponseDto.java @@ -1,10 +1,10 @@ -package sopt.org.umbba.domain.qna.controller.dto.response; +package sopt.org.umbba.api.controller.qna.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.domain.domain.qna.QnA; @Getter @Builder diff --git a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/QnAListResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/QnAListResponseDto.java similarity index 86% rename from src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/QnAListResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/QnAListResponseDto.java index b46602aa..50931530 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/QnAListResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/QnAListResponseDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.qna.controller.dto.response; +package sopt.org.umbba.api.controller.qna.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/SingleQnAResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/SingleQnAResponseDto.java similarity index 90% rename from src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/SingleQnAResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/SingleQnAResponseDto.java index 0f4b4d39..55372ff7 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/SingleQnAResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/SingleQnAResponseDto.java @@ -1,12 +1,12 @@ -package sopt.org.umbba.domain.qna.controller.dto.response; +package sopt.org.umbba.api.controller.qna.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.qna.model.QnA; -import sopt.org.umbba.domain.qna.model.Question; -import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.domain.qna.QnA; +import sopt.org.umbba.domain.domain.qna.Question; +import sopt.org.umbba.domain.domain.user.User; @Getter @Builder diff --git a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/TodayQnAResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/TodayQnAResponseDto.java similarity index 92% rename from src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/TodayQnAResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/TodayQnAResponseDto.java index 5fab4337..998d555b 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/controller/dto/response/TodayQnAResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/qna/dto/response/TodayQnAResponseDto.java @@ -1,12 +1,12 @@ -package sopt.org.umbba.domain.qna.controller.dto.response; +package sopt.org.umbba.api.controller.qna.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.qna.model.QnA; -import sopt.org.umbba.domain.qna.model.Question; -import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.domain.qna.QnA; +import sopt.org.umbba.domain.domain.qna.Question; +import sopt.org.umbba.domain.domain.user.User; @Getter @Builder diff --git a/src/main/java/sopt/org/umbba/domain/user/controller/AuthController.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/AuthController.java similarity index 77% rename from src/main/java/sopt/org/umbba/domain/user/controller/AuthController.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/user/AuthController.java index 608b353f..2c9407fa 100644 --- a/src/main/java/sopt/org/umbba/domain/user/controller/AuthController.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/AuthController.java @@ -1,17 +1,17 @@ -package sopt.org.umbba.domain.user.controller; +package sopt.org.umbba.api.controller.user; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbba.domain.user.controller.dto.request.RefreshRequestDto; -import sopt.org.umbba.domain.user.controller.dto.request.SocialLoginRequestDto; -import sopt.org.umbba.domain.user.controller.dto.response.UserLoginResponseDto; -import sopt.org.umbba.domain.user.service.AuthService; -import sopt.org.umbba.domain.user.social.kakao.KakaoLoginService; -import sopt.org.umbba.global.common.dto.ApiResponse; -import sopt.org.umbba.global.config.jwt.JwtProvider; -import sopt.org.umbba.global.config.jwt.TokenDto; -import sopt.org.umbba.global.exception.SuccessType; +import sopt.org.umbba.api.config.jwt.JwtProvider; +import sopt.org.umbba.api.config.jwt.TokenDto; +import sopt.org.umbba.api.controller.user.dto.request.RefreshRequestDto; +import sopt.org.umbba.api.controller.user.dto.request.SocialLoginRequestDto; +import sopt.org.umbba.api.controller.user.dto.response.UserLoginResponseDto; +import sopt.org.umbba.api.service.user.AuthService; +import sopt.org.umbba.api.service.user.social.kakao.KakaoLoginService; +import sopt.org.umbba.common.exception.SuccessType; +import sopt.org.umbba.common.exception.dto.ApiResponse; import java.security.NoSuchAlgorithmException; import java.security.Principal; diff --git a/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/RefreshRequestDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/RefreshRequestDto.java similarity index 86% rename from src/main/java/sopt/org/umbba/domain/user/controller/dto/request/RefreshRequestDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/RefreshRequestDto.java index 0f802b7a..525728fa 100644 --- a/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/RefreshRequestDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/RefreshRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.controller.dto.request; +package sopt.org.umbba.api.controller.user.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/SocialLoginRequestDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/SocialLoginRequestDto.java similarity index 88% rename from src/main/java/sopt/org/umbba/domain/user/controller/dto/request/SocialLoginRequestDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/SocialLoginRequestDto.java index 5de9e66f..c89ced53 100644 --- a/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/SocialLoginRequestDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/SocialLoginRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.user.controller.dto.request; +package sopt.org.umbba.api.controller.user.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/UserInfoDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/UserInfoDto.java similarity index 90% rename from src/main/java/sopt/org/umbba/domain/user/controller/dto/request/UserInfoDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/UserInfoDto.java index 5ed563f7..9336b0b4 100644 --- a/src/main/java/sopt/org/umbba/domain/user/controller/dto/request/UserInfoDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/request/UserInfoDto.java @@ -1,10 +1,10 @@ -package sopt.org.umbba.domain.user.controller.dto.request; +package sopt.org.umbba.api.controller.user.dto.request; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.domain.user.User; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; diff --git a/src/main/java/sopt/org/umbba/domain/user/controller/dto/response/UserLoginResponseDto.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/response/UserLoginResponseDto.java similarity index 88% rename from src/main/java/sopt/org/umbba/domain/user/controller/dto/response/UserLoginResponseDto.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/response/UserLoginResponseDto.java index 01e3c8ff..015b8442 100644 --- a/src/main/java/sopt/org/umbba/domain/user/controller/dto/response/UserLoginResponseDto.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/user/dto/response/UserLoginResponseDto.java @@ -1,12 +1,12 @@ -package sopt.org.umbba.domain.user.controller.dto.response; +package sopt.org.umbba.api.controller.user.dto.response; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; import lombok.Getter; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.social.SocialPlatform; -import sopt.org.umbba.global.config.jwt.TokenDto; +import sopt.org.umbba.api.config.jwt.TokenDto; +import sopt.org.umbba.domain.domain.user.SocialPlatform; +import sopt.org.umbba.domain.domain.user.User; @Getter @Builder diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/service/ParentchildService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild/ParentchildService.java similarity index 83% rename from src/main/java/sopt/org/umbba/domain/parentchild/service/ParentchildService.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild/ParentchildService.java index 0d0fde68..2ce1067c 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/service/ParentchildService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild/ParentchildService.java @@ -1,28 +1,23 @@ -package sopt.org.umbba.domain.parentchild.service; +package sopt.org.umbba.api.service.parentchild; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.RandomStringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbba.domain.parentchild.controller.dto.request.InviteCodeRequestDto; -import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingInviteRequestDto; -import sopt.org.umbba.domain.parentchild.controller.dto.request.OnboardingReceiveRequestDto; -import sopt.org.umbba.domain.parentchild.controller.dto.response.InviteResultResponseDto; -import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingInviteResponseDto; -import sopt.org.umbba.domain.parentchild.controller.dto.response.OnboardingReceiveResponseDto; -import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.parentchild.model.ParentchildRelation; -import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository; -import sopt.org.umbba.domain.qna.model.OnboardingAnswer; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.repository.UserRepository; -import sopt.org.umbba.global.config.ScheduleConfig; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; -import sopt.org.umbba.global.util.fcm.FCMScheduler; -import sopt.org.umbba.global.util.fcm.FCMService; +import sopt.org.umbba.api.controller.parentchild.dto.request.OnboardingInviteRequestDto; +import sopt.org.umbba.api.controller.parentchild.dto.request.OnboardingReceiveRequestDto; +import sopt.org.umbba.api.controller.parentchild.dto.response.OnboardingInviteResponseDto; +import sopt.org.umbba.api.controller.parentchild.dto.response.OnboardingReceiveResponseDto; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.parentchild.ParentchildRelation; +import sopt.org.umbba.domain.domain.parentchild.dao.ParentchildDao; +import sopt.org.umbba.domain.domain.parentchild.repository.ParentchildRepository; +import sopt.org.umbba.domain.domain.qna.OnboardingAnswer; +import sopt.org.umbba.domain.domain.user.User; +import sopt.org.umbba.domain.domain.user.repository.UserRepository; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/sopt/org/umbba/domain/qna/service/QnAService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java similarity index 92% rename from src/main/java/sopt/org/umbba/domain/qna/service/QnAService.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java index edd2a75d..a163be5c 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/service/QnAService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java @@ -1,33 +1,35 @@ -package sopt.org.umbba.domain.qna.service; +package sopt.org.umbba.api.service.qna; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbba.domain.parentchild.dao.ParentchildDao; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.qna.controller.dto.request.TodayAnswerRequestDto; -import sopt.org.umbba.domain.qna.controller.dto.response.*; -import sopt.org.umbba.domain.qna.model.*; -import sopt.org.umbba.domain.qna.repository.QnARepository; -import sopt.org.umbba.domain.qna.repository.QuestionRepository; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.repository.UserRepository; -import sopt.org.umbba.domain.user.social.SocialPlatform; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; -import sopt.org.umbba.global.util.fcm.FCMService; -import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto; - +import sopt.org.umbba.api.controller.qna.dto.request.TodayAnswerRequestDto; +import sopt.org.umbba.api.controller.qna.dto.response.*; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.parentchild.dao.ParentchildDao; +import sopt.org.umbba.domain.domain.qna.OnboardingAnswer; +import sopt.org.umbba.domain.domain.qna.QnA; +import sopt.org.umbba.domain.domain.qna.Question; +import sopt.org.umbba.domain.domain.qna.repository.QnARepository; +import sopt.org.umbba.domain.domain.qna.repository.QuestionRepository; +import sopt.org.umbba.domain.domain.user.SocialPlatform; +import sopt.org.umbba.domain.domain.user.User; +import sopt.org.umbba.domain.domain.user.repository.UserRepository; + +import javax.validation.constraints.NotNull; import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; -import static sopt.org.umbba.domain.qna.model.OnboardingAnswer.*; -import static sopt.org.umbba.domain.qna.model.QuestionSection.*; -import static sopt.org.umbba.domain.qna.model.QuestionType.*; +import static sopt.org.umbba.domain.domain.qna.OnboardingAnswer.NO; +import static sopt.org.umbba.domain.domain.qna.OnboardingAnswer.YES; +import static sopt.org.umbba.domain.domain.qna.QuestionSection.*; +import static sopt.org.umbba.domain.domain.qna.QuestionType.*; + @Slf4j @Service diff --git a/src/main/java/sopt/org/umbba/domain/user/service/AuthService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/AuthService.java similarity index 84% rename from src/main/java/sopt/org/umbba/domain/user/service/AuthService.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/user/AuthService.java index c7d76bc7..64a51721 100644 --- a/src/main/java/sopt/org/umbba/domain/user/service/AuthService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/AuthService.java @@ -1,23 +1,22 @@ -package sopt.org.umbba.domain.user.service; - +package sopt.org.umbba.api.service.user; import feign.FeignException; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbba.domain.user.controller.dto.request.RefreshRequestDto; -import sopt.org.umbba.domain.user.controller.dto.request.SocialLoginRequestDto; -import sopt.org.umbba.domain.user.controller.dto.response.UserLoginResponseDto; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.repository.UserRepository; -import sopt.org.umbba.domain.user.social.SocialPlatform; -import sopt.org.umbba.domain.user.social.apple.AppleLoginService; -import sopt.org.umbba.domain.user.social.kakao.KakaoLoginService; -import sopt.org.umbba.global.config.auth.UserAuthentication; -import sopt.org.umbba.global.config.jwt.JwtProvider; -import sopt.org.umbba.global.config.jwt.TokenDto; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.api.config.auth.UserAuthentication; +import sopt.org.umbba.api.config.jwt.JwtProvider; +import sopt.org.umbba.api.config.jwt.TokenDto; +import sopt.org.umbba.api.controller.user.dto.request.RefreshRequestDto; +import sopt.org.umbba.api.controller.user.dto.request.SocialLoginRequestDto; +import sopt.org.umbba.api.controller.user.dto.response.UserLoginResponseDto; +import sopt.org.umbba.api.service.user.social.apple.AppleLoginService; +import sopt.org.umbba.api.service.user.social.kakao.KakaoLoginService; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.domain.domain.user.SocialPlatform; +import sopt.org.umbba.domain.domain.user.User; +import sopt.org.umbba.domain.domain.user.repository.UserRepository; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/AppleLoginService.java similarity index 67% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/AppleLoginService.java index 69fb104d..d4624410 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/AppleLoginService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/AppleLoginService.java @@ -1,15 +1,16 @@ -package sopt.org.umbba.external.client.auth.apple; +package sopt.org.umbba.api.service.user.social.apple; import io.jsonwebtoken.Claims; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; -import sopt.org.umbba.domain.user.social.apple.feign.AppleApiClient; -import sopt.org.umbba.domain.user.social.apple.response.ApplePublicKeys; -import sopt.org.umbba.domain.user.social.apple.verify.AppleClaimsValidator; -import sopt.org.umbba.domain.user.social.apple.verify.AppleJwtParser; -import sopt.org.umbba.domain.user.social.apple.verify.PublicKeyGenerator; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.api.service.user.social.apple.verify.AppleClaimsValidator; +import sopt.org.umbba.api.service.user.social.apple.verify.AppleJwtParser; +import sopt.org.umbba.api.service.user.social.apple.verify.PublicKeyGenerator; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.external.client.auth.apple.AppleApiClient; +import sopt.org.umbba.external.client.auth.apple.response.ApplePublicKeys; + import java.security.PublicKey; import java.util.Map; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/AppleClaimsValidator.java similarity index 93% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/AppleClaimsValidator.java index dd964e52..f25deb13 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleClaimsValidator.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/AppleClaimsValidator.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.external.client.auth.apple.verify; +package sopt.org.umbba.api.service.user.social.apple.verify; import io.jsonwebtoken.Claims; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/AppleJwtParser.java similarity index 90% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/AppleJwtParser.java index ee9bd093..33942031 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/AppleJwtParser.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/AppleJwtParser.java @@ -1,12 +1,12 @@ -package sopt.org.umbba.external.client.auth.apple.verify; +package sopt.org.umbba.api.service.user.social.apple.verify; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.jsonwebtoken.*; import org.springframework.stereotype.Component; import org.springframework.util.Base64Utils; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; import java.security.PublicKey; import java.util.Map; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/EncryptUtils.java similarity index 80% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/EncryptUtils.java index b87a11f2..2211ed45 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/EncryptUtils.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/EncryptUtils.java @@ -1,7 +1,8 @@ -package sopt.org.umbba.external.client.auth.apple.verify; +package sopt.org.umbba.api.service.user.social.apple.verify; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; + +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/PublicKeyGenerator.java similarity index 91% rename from src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/PublicKeyGenerator.java index d01659ea..5e86e6e1 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/apple/verify/PublicKeyGenerator.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/apple/verify/PublicKeyGenerator.java @@ -1,11 +1,11 @@ -package sopt.org.umbba.external.client.auth.apple.verify; +package sopt.org.umbba.api.service.user.social.apple.verify; import org.springframework.stereotype.Component; import org.springframework.util.Base64Utils; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; import sopt.org.umbba.external.client.auth.apple.response.ApplePublicKey; import sopt.org.umbba.external.client.auth.apple.response.ApplePublicKeys; -import sopt.org.umbba.global.exception.CustomException; -import sopt.org.umbba.global.exception.ErrorType; import java.math.BigInteger; import java.security.KeyFactory; diff --git a/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/kakao/KakaoLoginService.java similarity index 84% rename from src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java rename to umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/kakao/KakaoLoginService.java index 19139026..e04aeb9c 100644 --- a/src/main/java/sopt/org/umbba/domain/user/social/kakao/KakaoLoginService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/social/kakao/KakaoLoginService.java @@ -1,14 +1,14 @@ -package sopt.org.umbba.external.client.auth.kakao; +package sopt.org.umbba.api.service.user.social.kakao; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import sopt.org.umbba.domain.user.model.User; -import sopt.org.umbba.domain.user.social.kakao.feign.KakaoApiClient; -import sopt.org.umbba.domain.user.social.kakao.feign.KakaoAuthApiClient; -import sopt.org.umbba.domain.user.social.kakao.response.KakaoAccessTokenResponse; -import sopt.org.umbba.domain.user.social.kakao.response.KakaoUserResponse; +import sopt.org.umbba.domain.domain.user.User; +import sopt.org.umbba.external.client.auth.kakao.KakaoApiClient; +import sopt.org.umbba.external.client.auth.kakao.KakaoAuthApiClient; +import sopt.org.umbba.external.client.auth.kakao.response.KakaoAccessTokenResponse; +import sopt.org.umbba.external.client.auth.kakao.response.KakaoUserResponse; @Service @Transactional diff --git a/umbba-domain/build.gradle b/umbba-domain/build.gradle index abcaf0bc..5c44fbc2 100644 --- a/umbba-domain/build.gradle +++ b/umbba-domain/build.gradle @@ -12,8 +12,12 @@ dependencies { // JSON implementation 'com.googlecode.json-simple:json-simple:1.1.1' + // redis + implementation "org.springframework.boot:spring-boot-starter-data-redis" + implementation "org.springframework.session:spring-session-data-redis" + // jackson -// implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: '2.12.7.1' + implementation group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2" // querydsl // implementation "com.querydsl:querydsl-jpa" diff --git a/src/main/java/sopt/org/umbba/domain/parentchild/dao/ParentchildDao.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/dao/ParentchildDao.java similarity index 97% rename from src/main/java/sopt/org/umbba/domain/parentchild/dao/ParentchildDao.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/dao/ParentchildDao.java index 2e2342fb..0bdeb38a 100644 --- a/src/main/java/sopt/org/umbba/domain/parentchild/dao/ParentchildDao.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/dao/ParentchildDao.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.parentchild.dao; +package sopt.org.umbba.domain.domain.parentchild.dao; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java index f2a6026d..c817bf19 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/OnboardingAnswer.java @@ -22,7 +22,7 @@ public static OnboardingAnswer of(String value) { return answer; } } - throw new CustomException(ErroType.INVALID_ONBOARDING_ANSWER); + throw new CustomException(ErrorType.INVALID_ONBOARDING_ANSWER); } } diff --git a/src/main/java/sopt/org/umbba/domain/qna/dao/QnADao.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java similarity index 96% rename from src/main/java/sopt/org/umbba/domain/qna/dao/QnADao.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java index 12dae991..d24d65df 100644 --- a/src/main/java/sopt/org/umbba/domain/qna/dao/QnADao.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.domain.qna.dao; +package sopt.org.umbba.domain.domain.qna.dao; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; diff --git a/src/main/java/sopt/org/umbba/global/config/jwt/redis/RefreshToken.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/RefreshToken.java similarity index 92% rename from src/main/java/sopt/org/umbba/global/config/jwt/redis/RefreshToken.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/RefreshToken.java index 2313e7ac..5d1f35c7 100644 --- a/src/main/java/sopt/org/umbba/global/config/jwt/redis/RefreshToken.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/RefreshToken.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config.jwt.redis; +package sopt.org.umbba.domain.domain.redis; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; diff --git a/src/main/java/sopt/org/umbba/global/config/jwt/redis/TokenRepository.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/TokenRepository.java similarity index 78% rename from src/main/java/sopt/org/umbba/global/config/jwt/redis/TokenRepository.java rename to umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/TokenRepository.java index b9f7b87e..508f20d2 100644 --- a/src/main/java/sopt/org/umbba/global/config/jwt/redis/TokenRepository.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/TokenRepository.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.global.config.jwt.redis; +package sopt.org.umbba.domain.domain.redis; import org.springframework.data.repository.CrudRepository; From 9d4616fbc90736d0cfc26eafd2ff7842b3003165 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 22:14:12 +0900 Subject: [PATCH 08/27] =?UTF-8?q?[MERGE]=20=EB=B3=91=ED=95=A9=20=EC=B6=A9?= =?UTF-8?q?=EB=8F=8C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sopt/org/umbba/UmbbaServerApplication.java | 15 --------------- .../org/umbba/UmbbaServerApplicationTests.java | 13 ------------- .../java/sopt/org/umbba/api/ApiApplication.java | 5 ++++- .../src}/main/resources/application.yaml | 0 .../config/scheduler/ScheduleConfig.java | 2 ++ 5 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 src/main/java/sopt/org/umbba/UmbbaServerApplication.java delete mode 100644 src/test/java/sopt/org/umbba/UmbbaServerApplicationTests.java rename {src => umbba-api/src}/main/resources/application.yaml (100%) diff --git a/src/main/java/sopt/org/umbba/UmbbaServerApplication.java b/src/main/java/sopt/org/umbba/UmbbaServerApplication.java deleted file mode 100644 index eccb1e78..00000000 --- a/src/main/java/sopt/org/umbba/UmbbaServerApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package sopt.org.umbba; - -//@EnableJpaAuditing -//@EnableScheduling -//@SpringBootApplication(exclude = { UserDetailsServiceAutoConfiguration.class }) -//@EnableFeignClients -//public class UmbbaServerApplication { -// -// public static void main(String[] args) { -// -// SpringApplication.run(UmbbaServerApplication.class, args); -// -// } -// -//} diff --git a/src/test/java/sopt/org/umbba/UmbbaServerApplicationTests.java b/src/test/java/sopt/org/umbba/UmbbaServerApplicationTests.java deleted file mode 100644 index 51ffac6a..00000000 --- a/src/test/java/sopt/org/umbba/UmbbaServerApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package sopt.org.umbba; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class UmbbaServerApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java b/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java index 16235de2..41514877 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java @@ -3,16 +3,19 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; +import org.springframework.cloud.openfeign.EnableFeignClients; import sopt.org.umbba.common.UmbbaCommonRoot; import sopt.org.umbba.domain.UmbbaDomainRoot; import sopt.org.umbba.external.UmbbaExternalRoot; +@EnableFeignClients @SpringBootApplication(scanBasePackageClasses = { UmbbaCommonRoot.class, UmbbaDomainRoot.class, UmbbaExternalRoot.class, ApiApplication.class -}) +}, exclude = { UserDetailsServiceAutoConfiguration.class }) public class ApiApplication { public static void main(String[] args) { diff --git a/src/main/resources/application.yaml b/umbba-api/src/main/resources/application.yaml similarity index 100% rename from src/main/resources/application.yaml rename to umbba-api/src/main/resources/application.yaml diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler/ScheduleConfig.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler/ScheduleConfig.java index b9c7d393..f88168ce 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler/ScheduleConfig.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/scheduler/ScheduleConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.TaskScheduler; +import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import sopt.org.umbba.notification.service.fcm.FCMService; @@ -12,6 +13,7 @@ * 특정 시간대에 알림을 보내주기 위해 Spring이 제공하는 TaskScheduler를 빈으로 등록 */ @Configuration +@EnableScheduling public class ScheduleConfig { private static final int POOL_SIZE = 10; From 4fbe1f955f39f4248b3510d8d248a218d619d2e9 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Tue, 8 Aug 2023 22:24:44 +0900 Subject: [PATCH 09/27] =?UTF-8?q?[CHORE]=20=EB=94=94=EB=A0=89=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=20=EA=B5=AC=EC=A1=B0=20=EC=B5=9C=EC=A0=81=ED=99=94=20?= =?UTF-8?q?#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../health}/SlackTestController.java | 2 +- umbba-notification/build.gradle | 1 - .../notification/config/fcm/FCMConfig.java | 2 +- .../fcm/FCMController.java | 21 +++++++------------ .../notification/service/fcm/FCMService.java | 5 +++-- .../fcm/dto/FCMMessage.java | 2 +- .../fcm/dto/FCMPushRequestDto.java | 2 +- .../fcm/dto/PushMessage.java | 2 +- .../service/scheduler/FCMScheduler.java | 1 + 9 files changed, 16 insertions(+), 22 deletions(-) rename {umbba-notification/src/main/java/sopt/org/umbba/notification/controller/slack => umbba-api/src/main/java/sopt/org/umbba/api/controller/health}/SlackTestController.java (92%) rename umbba-notification/src/main/java/sopt/org/umbba/notification/{controller => service}/fcm/FCMController.java (81%) rename umbba-notification/src/main/java/sopt/org/umbba/notification/{controller => service}/fcm/dto/FCMMessage.java (97%) rename umbba-notification/src/main/java/sopt/org/umbba/notification/{controller => service}/fcm/dto/FCMPushRequestDto.java (96%) rename umbba-notification/src/main/java/sopt/org/umbba/notification/{controller => service}/fcm/dto/PushMessage.java (92%) diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/slack/SlackTestController.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/SlackTestController.java similarity index 92% rename from umbba-notification/src/main/java/sopt/org/umbba/notification/controller/slack/SlackTestController.java rename to umbba-api/src/main/java/sopt/org/umbba/api/controller/health/SlackTestController.java index 1ff4d596..516dc45b 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/slack/SlackTestController.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/SlackTestController.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.notification.controller.slack; +package sopt.org.umbba.api.controller.health; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; diff --git a/umbba-notification/build.gradle b/umbba-notification/build.gradle index f4783422..1fb9fb2c 100644 --- a/umbba-notification/build.gradle +++ b/umbba-notification/build.gradle @@ -18,5 +18,4 @@ dependencies { implementation 'com.squareup.okhttp3:okhttp:4.10.0' implementation 'com.slack.api:slack-app-backend:1.28.0' implementation 'com.slack.api:slack-api-model:1.28.0' - implementation project(path: ':umbba-common') } \ No newline at end of file diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java index ec52548c..a9f62495 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java @@ -11,7 +11,7 @@ import org.springframework.core.io.ClassPathResource; import sopt.org.umbba.common.exception.ErrorType; import sopt.org.umbba.common.exception.model.CustomException; -import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto; +import sopt.org.umbba.notification.service.fcm.dto.FCMPushRequestDto; import javax.annotation.PostConstruct; import java.io.IOException; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/FCMController.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMController.java similarity index 81% rename from umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/FCMController.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMController.java index bb10ab27..69d0cb32 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/FCMController.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMController.java @@ -1,17 +1,10 @@ -package sopt.org.umbba.notification.controller.fcm; +package sopt.org.umbba.notification.service.fcm; import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import sopt.org.umbba.common.exception.SuccessType; -import sopt.org.umbba.common.exception.dto.ApiResponse; -import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto; import sopt.org.umbba.notification.service.fcm.FCMService; import sopt.org.umbba.notification.service.scheduler.FCMScheduler; -import java.io.IOException; -import java.security.Principal; - @RestController @RequestMapping("/alarm") @RequiredArgsConstructor @@ -25,11 +18,11 @@ public class FCMController { * 새로운 질문이 도착했음을 알리는 푸시 알림 활성화 API * 실제로는 초대 받는측의 온보딩이 완료되었을 때 호출됨 */ - @PostMapping("/qna") + /*@PostMapping("/qna") @ResponseStatus(HttpStatus.OK) public ApiResponse sendTopicScheduledTest() { return ApiResponse.success(SuccessType.PUSH_ALARM_PERIODIC_SUCCESS, fcmScheduler.pushTodayQna()); - } + }*/ /** * 장난용 푸시 알림 활성화 API @@ -44,21 +37,21 @@ public ApiResponse sendTopicScheduledTest() { /** * 헤더와 바디를 직접 만들어 알림을 전송하는 테스트용 API (상대 답변 알람 전송에 사용) */ - @PostMapping + /*@PostMapping @ResponseStatus(HttpStatus.OK) public ApiResponse sendNotificationByToken(@RequestBody FCMPushRequestDto request, Principal principal) throws IOException { return ApiResponse.success(SuccessType.PUSH_ALARM_SUCCESS, fcmService.pushAlarm(request, JwtProvider.getUserFromPrincial(principal))); - } + }*/ /** * 동시에 여러 사람에게 푸시 알림을 보내보는 테스트용 API (주기적 알람 전송에 사용) */ - @PostMapping("/parentchild") + /*@PostMapping("/parentchild") @ResponseStatus(HttpStatus.OK) public ApiResponse sendMultiScheduledTest() { return ApiResponse.success(SuccessType.PUSH_ALARM_SUCCESS, fcmService.multipleSendByToken(FCMPushRequestDto.sendTodayQna("section", "question") ,93L)); - } + }*/ } diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java index 2c715d99..a3267b05 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java @@ -22,13 +22,14 @@ import sopt.org.umbba.common.exception.ErrorType; import sopt.org.umbba.common.exception.model.CustomException; import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.parentchild.dao.ParentchildDao; import sopt.org.umbba.domain.domain.parentchild.repository.ParentchildRepository; import sopt.org.umbba.domain.domain.qna.QnA; import sopt.org.umbba.domain.domain.user.SocialPlatform; import sopt.org.umbba.domain.domain.user.User; import sopt.org.umbba.domain.domain.user.repository.UserRepository; -import sopt.org.umbba.notification.controller.fcm.dto.FCMMessage; -import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto; +import sopt.org.umbba.notification.service.fcm.dto.FCMMessage; +import sopt.org.umbba.notification.service.fcm.dto.FCMPushRequestDto; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMMessage.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMMessage.java similarity index 97% rename from umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMMessage.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMMessage.java index 334fb21b..d7ebeafa 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMMessage.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMMessage.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.notification.controller.fcm.dto; +package sopt.org.umbba.notification.service.fcm.dto; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMPushRequestDto.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMPushRequestDto.java similarity index 96% rename from umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMPushRequestDto.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMPushRequestDto.java index 98fd18a5..34eb8423 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/FCMPushRequestDto.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMPushRequestDto.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.notification.controller.fcm.dto; +package sopt.org.umbba.notification.service.fcm.dto; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.*; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/PushMessage.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/PushMessage.java similarity index 92% rename from umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/PushMessage.java rename to umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/PushMessage.java index 1c23b3c6..8f9fc2b6 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/controller/fcm/dto/PushMessage.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/PushMessage.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.notification.controller.fcm.dto; +package sopt.org.umbba.notification.service.fcm.dto; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler/FCMScheduler.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler/FCMScheduler.java index 2d1fc040..a03be6bb 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler/FCMScheduler.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/scheduler/FCMScheduler.java @@ -5,6 +5,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import sopt.org.umbba.domain.domain.parentchild.dao.ParentchildDao; import sopt.org.umbba.domain.domain.parentchild.repository.ParentchildRepository; import sopt.org.umbba.domain.domain.user.SocialPlatform; import sopt.org.umbba.domain.domain.user.User; From 5ad7feff52ccd79e6c9493adb25db26937fc084d Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 22:40:17 +0900 Subject: [PATCH 10/27] =?UTF-8?q?[REFACTOR]=20import=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= =?UTF-8?q?=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parentchild/ParentchildService.java | 14 ++++++----- .../org/umbba/api/service/qna/QnAService.java | 24 +++++++++++-------- .../domain/parentchild/Parentchild.java | 1 + .../parentchild/dao/ParentchildDao.java | 4 ++-- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild/ParentchildService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild/ParentchildService.java index 2ce1067c..9cb2c8db 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild/ParentchildService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/parentchild/ParentchildService.java @@ -5,8 +5,10 @@ import org.apache.commons.lang3.RandomStringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import sopt.org.umbba.api.controller.parentchild.dto.request.InviteCodeRequestDto; import sopt.org.umbba.api.controller.parentchild.dto.request.OnboardingInviteRequestDto; import sopt.org.umbba.api.controller.parentchild.dto.request.OnboardingReceiveRequestDto; +import sopt.org.umbba.api.controller.parentchild.dto.response.InviteResultResponseDto; import sopt.org.umbba.api.controller.parentchild.dto.response.OnboardingInviteResponseDto; import sopt.org.umbba.api.controller.parentchild.dto.response.OnboardingReceiveResponseDto; import sopt.org.umbba.common.exception.ErrorType; @@ -19,6 +21,7 @@ import sopt.org.umbba.domain.domain.user.User; import sopt.org.umbba.domain.domain.user.repository.UserRepository; +import javax.validation.Valid; import java.util.List; import java.util.stream.Collectors; @@ -31,8 +34,7 @@ public class ParentchildService { private final ParentchildRepository parentchildRepository; private final UserRepository userRepository; private final ParentchildDao parentchildDao; - private final FCMScheduler fcmScheduler; - private final FCMService fcmService; +// private final FCMScheduler fcmScheduler; TODO ⭐️SQS로 변경 // [발신] 초대하는 측의 온보딩 정보 입력 @Transactional @@ -118,9 +120,9 @@ public OnboardingReceiveResponseDto onboardReceive(Long userId, OnboardingReceiv /*if (!ParentchildRelation.validate(parentChildUsers, parentchild.getRelation())) { throw new CustomException(ErrorType.INVALID_PARENT_CHILD_RELATION); }*/ - ScheduleConfig.resetScheduler(); - fcmScheduler.pushTodayQna(); - + // TODO ⭐️SQS로 변경 +// ScheduleConfig.resetScheduler(); +// fcmScheduler.pushTodayQna(); return OnboardingReceiveResponseDto.of(parentchild, user, parentChildUsers); @@ -135,7 +137,7 @@ private String generateInviteCode() { // 초대코드 확인 후 부모자식 관계 성립 @Transactional - public InviteResultResponseDto matchRelation(Long userId, InviteCodeRequestDto request) { + public InviteResultResponseDto matchRelation(Long userId, @Valid InviteCodeRequestDto request) { log.info("ParentchlidService 실행 - 요청 초대코드: {}", request.getInviteCode()); Parentchild newMatchRelation = parentchildRepository.findByInviteCode(request.getInviteCode()).orElseThrow( diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java index a163be5c..d1d5b393 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java @@ -41,7 +41,7 @@ public class QnAService { private final QuestionRepository questionRepository; private final UserRepository userRepository; private final ParentchildDao parentchildDao; - private final FCMService fcmService; //TODO Service에서 Service를 주입받는 부분 수정 +// private final FCMService fcmService; //TODO ⭐️SQS로 변경 public TodayQnAResponseDto getTodayQnA(Long userId) { @@ -82,10 +82,12 @@ public void answerTodayQuestion(Long userId, TodayAnswerRequestDto request) { if (myUser.isMeChild()) { todayQnA.saveChildAnswer(request.getAnswer()); - fcmService.pushOpponentReply(todayQnA.getQuestion().getParentQuestion(), opponentUser.getId()); + //TODO ⭐️SQS로 변경 +// fcmService.pushOpponentReply(todayQnA.getQuestion().getParentQuestion(), opponentUser.getId()); } else { todayQnA.saveParentAnswer(request.getAnswer()); - fcmService.pushOpponentReply(todayQnA.getQuestion().getChildQuestion(), opponentUser.getId()); + //TODO ⭐️SQS로 변경 +// fcmService.pushOpponentReply(todayQnA.getQuestion().getChildQuestion(), opponentUser.getId()); } } @@ -237,7 +239,7 @@ private User getOpponentByParentchild(Parentchild parentchild, Long userId) { } @Transactional - private void customQuestion(List childList, List parentList, List qnAList) { + public void customQuestion(List childList, List parentList, List qnAList) { // Type 1 : 1번째 선택 질문인 거주 현황에 대해 한명이라도 아니/애매해라고 답한 경우 if (childList.get(0) != YES || parentList.get(0) !=YES) { @@ -344,9 +346,10 @@ public void updateDemoList(Long userId) { } QnA fifthQnA = getTodayQnAByParentchild(parentchild); log.info("💖💖💖💖Day 5 QnA: {}", fifthQnA.getId()); - fcmService.multipleSendByToken(FCMPushRequestDto.sendTodayQna( - fifthQnA.getQuestion().getSection().getValue(), - fifthQnA.getQuestion().getTopic()), parentchild.getId()); + //TODO ⭐️SQS로 변경 +// fcmService.multipleSendByToken(FCMPushRequestDto.sendTodayQna( +// fifthQnA.getQuestion().getSection().getValue(), +// fifthQnA.getQuestion().getTopic()), parentchild.getId()); } @@ -361,9 +364,10 @@ public void todayUpdate(Long userId) { "오구 내 똥강아지~ 어렸을 때는 매일 볼 수 있었는데, 어른이 되고 나서 자주 못봐서 너무 아쉽다... 연락 잘하거라 요녀석~"); QnA todayQnA = getTodayQnAByParentchild(parentchild); - fcmService.multipleSendByToken(FCMPushRequestDto.sendTodayQna( - todayQnA.getQuestion().getSection().getValue(), - todayQnA.getQuestion().getTopic()), parentchild.getId()); + //TODO ⭐️SQS로 변경 +// fcmService.multipleSendByToken(FCMPushRequestDto.sendTodayQna( +// todayQnA.getQuestion().getSection().getValue(), +// todayQnA.getQuestion().getTopic()), parentchild.getId()); } private void updateDay(Parentchild parentchild, String childAnswer, String parentAnswer) { diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java index 76345308..e70ed889 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java @@ -3,6 +3,7 @@ import lombok.*; import lombok.extern.slf4j.Slf4j; import sopt.org.umbba.domain.domain.common.AuditingTimeEntity; +import sopt.org.umbba.domain.domain.qna.OnboardingAnswer; import sopt.org.umbba.domain.domain.qna.QnA; import javax.persistence.*; diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/dao/ParentchildDao.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/dao/ParentchildDao.java index 0bdeb38a..adf41436 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/dao/ParentchildDao.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/dao/ParentchildDao.java @@ -2,8 +2,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; -import sopt.org.umbba.domain.parentchild.model.Parentchild; -import sopt.org.umbba.domain.user.model.User; +import sopt.org.umbba.domain.domain.parentchild.Parentchild; +import sopt.org.umbba.domain.domain.user.User; import javax.persistence.EntityManager; import javax.persistence.NoResultException; From bc931fa8e43a1b0f3a906e48d72741d84cfdf932 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Tue, 8 Aug 2023 22:49:58 +0900 Subject: [PATCH 11/27] =?UTF-8?q?[FIX]=20import=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umbba/domain/domain/parentchild/ParentchildRelation.java | 2 ++ .../main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java | 2 +- umbba-external/build.gradle | 3 +++ .../external/client/auth/kakao/response/KakaoUserProfile.java | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java index f72673ac..39a84dc2 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java @@ -3,6 +3,8 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; import sopt.org.umbba.domain.domain.user.User; import java.util.List; diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java index d24d65df..bb629199 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java @@ -2,7 +2,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; -import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.domain.domain.qna.QnA; import javax.persistence.EntityManager; import javax.persistence.NoResultException; diff --git a/umbba-external/build.gradle b/umbba-external/build.gradle index 5ecee613..a35544e2 100644 --- a/umbba-external/build.gradle +++ b/umbba-external/build.gradle @@ -4,6 +4,9 @@ jar { enabled = true } dependencies { implementation project(":umbba-common") + // JSON + implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2' + // Social Login implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.7' diff --git a/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserProfile.java b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserProfile.java index 570db947..5303e0ea 100644 --- a/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserProfile.java +++ b/umbba-external/src/main/java/sopt/org/umbba/external/client/auth/kakao/response/KakaoUserProfile.java @@ -1,8 +1,9 @@ package sopt.org.umbba.external.client.auth.kakao.response; +import lombok.*; + import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; -import lombok.*; @ToString @Getter From 72957593b64447c1dc2e09f3bc576d33fe8e934b Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 22:50:20 +0900 Subject: [PATCH 12/27] =?UTF-8?q?[FIX]=20=EB=B9=8C=EB=93=9C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umbba/domain/domain/parentchild/ParentchildRelation.java | 2 ++ .../main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java | 2 +- umbba-external/build.gradle | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java index f72673ac..39a84dc2 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/ParentchildRelation.java @@ -3,6 +3,8 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; import sopt.org.umbba.domain.domain.user.User; import java.util.List; diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java index d24d65df..bb629199 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/qna/dao/QnADao.java @@ -2,7 +2,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; -import sopt.org.umbba.domain.qna.model.QnA; +import sopt.org.umbba.domain.domain.qna.QnA; import javax.persistence.EntityManager; import javax.persistence.NoResultException; diff --git a/umbba-external/build.gradle b/umbba-external/build.gradle index 5ecee613..3a316ffc 100644 --- a/umbba-external/build.gradle +++ b/umbba-external/build.gradle @@ -9,4 +9,7 @@ dependencies { // spring webflux // implementation "org.springframework.boot:spring-boot-starter-webflux" + + // JSON Ignore + implementation group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2" } \ No newline at end of file From ab1c0bc3f511a418864275ac714bbf85cf5cfea0 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Tue, 8 Aug 2023 22:51:47 +0900 Subject: [PATCH 13/27] =?UTF-8?q?[CHORE]=20=EC=9D=98=EC=A1=B4=EC=84=B1=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umbba-external/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/umbba-external/build.gradle b/umbba-external/build.gradle index 1e8b9794..264e4e7c 100644 --- a/umbba-external/build.gradle +++ b/umbba-external/build.gradle @@ -4,8 +4,6 @@ jar { enabled = true } dependencies { implementation project(":umbba-common") - // JSON - implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2' // Social Login implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.7' From 7a9dba59b7adef4eacbbf9ab19821514858f9620 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Tue, 8 Aug 2023 22:56:51 +0900 Subject: [PATCH 14/27] =?UTF-8?q?[DOCS]=20=EB=AF=B8=EC=82=AC=EC=9A=A9=20de?= =?UTF-8?q?pendency=20=EC=A0=9C=EA=B1=B0=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umbba-common/build.gradle | 7 +------ umbba-external/build.gradle | 7 +++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/umbba-common/build.gradle b/umbba-common/build.gradle index 0021debc..5a66b154 100644 --- a/umbba-common/build.gradle +++ b/umbba-common/build.gradle @@ -5,11 +5,6 @@ dependencies { // for HttpStatus implementation 'org.springframework.boot:spring-boot-starter-web' - // redis - implementation "org.springframework.boot:spring-boot-starter-data-redis" - - // jwt - implementation group: "io.jsonwebtoken", name: "jjwt-api", version: "0.11.2" - implementation group: "io.jsonwebtoken", name: "jjwt-impl", version: "0.11.2" + // Jackson implementation group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2" } \ No newline at end of file diff --git a/umbba-external/build.gradle b/umbba-external/build.gradle index 264e4e7c..1bc7fa04 100644 --- a/umbba-external/build.gradle +++ b/umbba-external/build.gradle @@ -4,13 +4,12 @@ jar { enabled = true } dependencies { implementation project(":umbba-common") - // Social Login implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.7' + // for JsonIgnore + implementation group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2" + // spring webflux // implementation "org.springframework.boot:spring-boot-starter-webflux" - - // JSON Ignore - implementation group: "io.jsonwebtoken", name: "jjwt-jackson", version: "0.11.2" } \ No newline at end of file From 55a71af458ae9dd386feba05a42fc1961b3caeda Mon Sep 17 00:00:00 2001 From: jun02160 Date: Wed, 9 Aug 2023 02:55:58 +0900 Subject: [PATCH 15/27] =?UTF-8?q?[FIX]=20import=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umbba-api/build.gradle | 3 +- .../org/umbba/api/config/sqs/SqsConfig.java | 33 +++++++++++++++++++ .../api/config/sqs/producer/SqsProducer.java | 13 ++++++++ umbba-api/src/main/resources/application.yaml | 10 +++++- .../src/main/resources/application.yaml | 12 +++---- 5 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/SqsConfig.java create mode 100644 umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java diff --git a/umbba-api/build.gradle b/umbba-api/build.gradle index 66ff93ef..5a8c676a 100644 --- a/umbba-api/build.gradle +++ b/umbba-api/build.gradle @@ -29,4 +29,5 @@ dependencies { // s3 // implementation "org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE" -} \ No newline at end of file +} + diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/SqsConfig.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/SqsConfig.java new file mode 100644 index 00000000..adc5d50a --- /dev/null +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/SqsConfig.java @@ -0,0 +1,33 @@ +package sopt.org.umbba.api.config.sqs; + +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.sqs.AmazonSQSAsync; +import com.amazonaws.services.sqs.AmazonSQSAsyncClientBuilder; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +@Configuration +public class SqsConfig { + + @Value("${cloud.aws.credentials.accessKey}") + private String AWS_ACCESS_KEY; + + @Value("${cloud.aws.credentials.secretKey}") + private String AWS_SECRET_KEY; + + @Value("${cloud.aws.region.static}") + private String AWS_REGION; + + @Primary + @Bean + public AmazonSQSAsync amazonSQSAsync() { + BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY); + return AmazonSQSAsyncClientBuilder.standard() + .withRegion(AWS_REGION) + .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials)) + .build(); + } +} diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java new file mode 100644 index 00000000..d78d1120 --- /dev/null +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java @@ -0,0 +1,13 @@ +package sopt.org.umbba.api.config.sqs.producer; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class SqsProducer { + + @Value("${cloud.aws.sqs.notification.url}") + private String notificationUrl; + + private static final String GROUP_ID = "sqs"; +} diff --git a/umbba-api/src/main/resources/application.yaml b/umbba-api/src/main/resources/application.yaml index 9637555f..63ac9f11 100644 --- a/umbba-api/src/main/resources/application.yaml +++ b/umbba-api/src/main/resources/application.yaml @@ -9,6 +9,14 @@ cloud: bucket: ${bucket-name} stack: auto: false + sqs: + notification: + name: ${sqs-notification-name} + url: ${sqs-notification-url} + #api: + # name: ${sqs-api-name} + # url: ${sqs-api-url} + spring: datasource: @@ -62,4 +70,4 @@ logging: sql: debug server: - port: 9091 + port: 9091 \ No newline at end of file diff --git a/umbba-notification/src/main/resources/application.yaml b/umbba-notification/src/main/resources/application.yaml index acf23877..63ac9f11 100644 --- a/umbba-notification/src/main/resources/application.yaml +++ b/umbba-notification/src/main/resources/application.yaml @@ -11,11 +11,11 @@ cloud: auto: false sqs: notification: - name: ${AWS_SQS_NOTIFICATION_NAME_DEV} - url: ${AWS_SQS_NOTIFICATION_URL_DEV} - api: - name: ${AWS_SQS_API_NAME_DEV} - url: ${AWS_SQS_API_URL_DEV} + name: ${sqs-notification-name} + url: ${sqs-notification-url} + #api: + # name: ${sqs-api-name} + # url: ${sqs-api-url} spring: @@ -70,4 +70,4 @@ logging: sql: debug server: - port: 9091 + port: 9091 \ No newline at end of file From e9c78edda6fd6f8e1982c9deee64329fa2711f53 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Wed, 9 Aug 2023 02:57:14 +0900 Subject: [PATCH 16/27] =?UTF-8?q?[DOCS]=20=EC=84=9C=EB=B2=84=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EC=8B=9C=20=EB=B0=9C=EC=83=9D=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umbba-api/build.gradle | 6 ++++++ .../src/main/java/sopt/org/umbba/api/ApiApplication.java | 2 +- .../java/sopt/org/umbba/api/config/jwt/JwtProvider.java | 1 - .../sopt/org/umbba/api/config/jwt}/TokenRepository.java | 3 ++- umbba-api/src/main/resources/application.yaml | 2 +- .../org/umbba/domain/domain/parentchild/Parentchild.java | 2 ++ umbba-notification/build.gradle | 2 ++ 7 files changed, 14 insertions(+), 4 deletions(-) rename {umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis => umbba-api/src/main/java/sopt/org/umbba/api/config/jwt}/TokenRepository.java (64%) diff --git a/umbba-api/build.gradle b/umbba-api/build.gradle index 66ff93ef..4ef29479 100644 --- a/umbba-api/build.gradle +++ b/umbba-api/build.gradle @@ -1,3 +1,5 @@ +jar { enabled = false } + dependencies { implementation project(':umbba-common') implementation project(':umbba-domain') @@ -27,6 +29,10 @@ dependencies { // for FeignException implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.7' + // redis + implementation "org.springframework.boot:spring-boot-starter-data-redis" + implementation "org.springframework.session:spring-session-data-redis" + // s3 // implementation "org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE" } \ No newline at end of file diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java b/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java index 41514877..97943392 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/ApiApplication.java @@ -9,13 +9,13 @@ import sopt.org.umbba.domain.UmbbaDomainRoot; import sopt.org.umbba.external.UmbbaExternalRoot; -@EnableFeignClients @SpringBootApplication(scanBasePackageClasses = { UmbbaCommonRoot.class, UmbbaDomainRoot.class, UmbbaExternalRoot.class, ApiApplication.class }, exclude = { UserDetailsServiceAutoConfiguration.class }) +@EnableFeignClients(basePackageClasses = UmbbaExternalRoot.class) public class ApiApplication { public static void main(String[] args) { diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtProvider.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtProvider.java index bea4ce2c..77482664 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtProvider.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/JwtProvider.java @@ -9,7 +9,6 @@ import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; import sopt.org.umbba.domain.domain.redis.RefreshToken; -import sopt.org.umbba.domain.domain.redis.TokenRepository; import sopt.org.umbba.common.exception.ErrorType; import sopt.org.umbba.common.exception.model.CustomException; diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/TokenRepository.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/TokenRepository.java similarity index 64% rename from umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/TokenRepository.java rename to umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/TokenRepository.java index 508f20d2..4de694a1 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/redis/TokenRepository.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/jwt/TokenRepository.java @@ -1,6 +1,7 @@ -package sopt.org.umbba.domain.domain.redis; +package sopt.org.umbba.api.config.jwt; import org.springframework.data.repository.CrudRepository; +import sopt.org.umbba.domain.domain.redis.RefreshToken; //Redis에 저장해주는 역할 public interface TokenRepository extends CrudRepository { diff --git a/umbba-api/src/main/resources/application.yaml b/umbba-api/src/main/resources/application.yaml index 9637555f..d92d6346 100644 --- a/umbba-api/src/main/resources/application.yaml +++ b/umbba-api/src/main/resources/application.yaml @@ -62,4 +62,4 @@ logging: sql: debug server: - port: 9091 + port: 9092 diff --git a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java index e70ed889..b77985e0 100644 --- a/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java +++ b/umbba-domain/src/main/java/sopt/org/umbba/domain/domain/parentchild/Parentchild.java @@ -47,11 +47,13 @@ public void addCount() { @Enumerated(EnumType.STRING) @Column(name = "answer", nullable = false) @ElementCollection + @Builder.Default private List childOnboardingAnswerList = new ArrayList<>(); @Enumerated(EnumType.STRING) @Column(name = "answer", nullable = false) @ElementCollection + @Builder.Default private List parentOnboardingAnswerList = new ArrayList<>(); public void changeChildOnboardingAnswerList(List onboardingAnswerList) { diff --git a/umbba-notification/build.gradle b/umbba-notification/build.gradle index 1fb9fb2c..533d885c 100644 --- a/umbba-notification/build.gradle +++ b/umbba-notification/build.gradle @@ -1,3 +1,5 @@ +jar { enabled = false } + dependencies { implementation project(":umbba-domain") implementation project(":umbba-common") From 00abc937fa471e382fa46b178413f170cc5fc320 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Thu, 10 Aug 2023 22:30:05 +0900 Subject: [PATCH 17/27] =?UTF-8?q?[FEAT]=20SQSConsmer,=20SQSProducer=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20#87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/config/sqs/producer/SqsProducer.java | 71 ++++++++++++++++++- .../common/sqs}/dto/FCMPushRequestDto.java | 10 ++- .../umbba/common/sqs}/dto/PushMessage.java | 2 +- .../org/umbba/common/sqs/dto/SlackDto.java | 3 + .../notification/config/fcm/FCMConfig.java | 2 +- .../config/sqs/consumer/SqsConsumer.java | 66 +++++++++++++++++ .../notification/service/fcm/FCMService.java | 2 +- .../notification/service/slack/SlackApi.java | 14 ++-- 8 files changed, 155 insertions(+), 15 deletions(-) rename {umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm => umbba-common/src/main/java/sopt/org/umbba/common/sqs}/dto/FCMPushRequestDto.java (83%) rename {umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm => umbba-common/src/main/java/sopt/org/umbba/common/sqs}/dto/PushMessage.java (92%) create mode 100644 umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java index d78d1120..9696ced4 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java @@ -1,13 +1,80 @@ package sopt.org.umbba.api.config.sqs.producer; +import com.amazonaws.services.sqs.AmazonSQS; +import com.amazonaws.services.sqs.model.MessageAttributeValue; +import com.amazonaws.services.sqs.model.SendMessageRequest; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import sopt.org.umbba.common.sqs.MessageType; +import sopt.org.umbba.common.sqs.MessageUtils; +import sopt.org.umbba.common.sqs.dto.MessageDto; +import java.util.Map; +import java.util.UUID; + +/** + * 큐에 메시지를 보내는 역할: API 서버에서 이벤트가 발생할 떄 푸시알림 전송 + * -> 처음 SQS 대기열 생성에서 설정해둔 사항이 여기서 적용 (지연시간, 메시지 수신 대기 등) + * + * 1. 처리할 작업 메시지를 SQS에 등록 + * 2. 큐에서 메시지를 소비(consume)하는 것을 실패한 경우, DLQ로 전송 + * + * TODO 기존에 푸시알림을 파이어베이스로 보내기 위해 호출했던 함수를 SQS Producer로 대체 + */ +@Slf4j @Component public class SqsProducer { @Value("${cloud.aws.sqs.notification.url}") - private String notificationUrl; + private String NOTIFICATION_URL; private static final String GROUP_ID = "sqs"; -} + private final ObjectMapper objectMapper; + private final AmazonSQS amazonSqs; + private static final String SQS_QUEUE_REQUEST_LOG_MESSAGE = "====> [SQS Queue Request] : %s "; + + public SqsProducer(ObjectMapper objectMapper, AmazonSQS amazonSqs) { + this.objectMapper = objectMapper; + this.amazonSqs = amazonSqs; + } + + + public void produce(MessageDto message) { + try { + SendMessageRequest request = new SendMessageRequest(NOTIFICATION_URL, + objectMapper.writeValueAsString(message)) + .withMessageGroupId(GROUP_ID) + .withMessageDeduplicationId(GROUP_ID) // TODO UUID Random String으로 변경 + .withMessageAttributes(createMessageAttributes(message.getType())); + + amazonSqs.sendMessage(request); + log.info(MessageUtils.generate(SQS_QUEUE_REQUEST_LOG_MESSAGE, request)); + + } catch (JsonProcessingException e) { + log.error(e.getMessage(), e); + } + } + + private Map createMessageAttributes(String type) { + + return Map.of(MessageType.MESSAGE_TYPE_HEADER, new MessageAttributeValue() + .withDataType("String") + .withStringValue(type)); + } + + + /* Queue에 단일 메시지를 보내는 함수 -> SQS 실습에서 사용한 함수 + public SendResult sendMessage(String groupId, String message) { +// Message newMessage = MessageBuilder.withPayload(message).build(); + System.out.println("Sender: " + message); + return queueMessagingTemplate.send(to -> to + .queue(QUEUE_NAME) + .messageGroupId(groupId) + .messageDeduplicationId(groupId) + .payload(message)); + } + */ +} \ No newline at end of file diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMPushRequestDto.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/FCMPushRequestDto.java similarity index 83% rename from umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMPushRequestDto.java rename to umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/FCMPushRequestDto.java index 34eb8423..923faad7 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/FCMPushRequestDto.java +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/FCMPushRequestDto.java @@ -1,15 +1,17 @@ -package sopt.org.umbba.notification.service.fcm.dto; +package sopt.org.umbba.common.sqs.dto; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.*; +import lombok.experimental.SuperBuilder; import lombok.extern.slf4j.Slf4j; +import sopt.org.umbba.common.sqs.MessageType; @Slf4j @Getter -@Builder +@SuperBuilder @AllArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PRIVATE) -public class FCMPushRequestDto { +public class FCMPushRequestDto extends MessageDto{ private String targetToken; @@ -24,6 +26,7 @@ public class FCMPushRequestDto { public static FCMPushRequestDto sendTodayQna(String section, String topic) { return FCMPushRequestDto.builder() + .type(MessageType.FIREBASE) .title("📞" + section + PushMessage.TODAY_QNA.getTitle()) .body("'" + topic + PushMessage.TODAY_QNA.getBody()) .build(); @@ -33,6 +36,7 @@ public static FCMPushRequestDto sendTodayQna(String section, String topic) { public static FCMPushRequestDto sendOpponentReply(String targetToken, String question) { return FCMPushRequestDto.builder() + .type(MessageType.FIREBASE) .targetToken(targetToken) .title(PushMessage.OPPONENT_REPLY.getTitle()) .body("'" + question + PushMessage.OPPONENT_REPLY.getBody()) diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/PushMessage.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/PushMessage.java similarity index 92% rename from umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/PushMessage.java rename to umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/PushMessage.java index 8f9fc2b6..9ab5ea22 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/dto/PushMessage.java +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/PushMessage.java @@ -1,4 +1,4 @@ -package sopt.org.umbba.notification.service.fcm.dto; +package sopt.org.umbba.common.sqs.dto; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java index 4126504b..fdcd3bbc 100644 --- a/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java +++ b/umbba-common/src/main/java/sopt/org/umbba/common/sqs/dto/SlackDto.java @@ -4,6 +4,8 @@ import lombok.experimental.SuperBuilder; import sopt.org.umbba.common.sqs.MessageType; +import javax.servlet.http.HttpServletRequest; + @ToString @Getter @NoArgsConstructor(access = AccessLevel.PRIVATE) @@ -12,6 +14,7 @@ public class SlackDto extends MessageDto { private Exception error; + private HttpServletRequest request; private String requestMethod; private String requestURI; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java index a9f62495..1bc81e06 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/fcm/FCMConfig.java @@ -11,7 +11,7 @@ import org.springframework.core.io.ClassPathResource; import sopt.org.umbba.common.exception.ErrorType; import sopt.org.umbba.common.exception.model.CustomException; -import sopt.org.umbba.notification.service.fcm.dto.FCMPushRequestDto; +import sopt.org.umbba.common.sqs.dto.FCMPushRequestDto; import javax.annotation.PostConstruct; import java.io.IOException; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java new file mode 100644 index 00000000..8fce5aa0 --- /dev/null +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java @@ -0,0 +1,66 @@ +package sopt.org.umbba.notification.config.sqs.consumer; + +import com.amazonaws.services.sqs.AmazonSQS; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.cloud.aws.messaging.listener.Acknowledgment; +import org.springframework.cloud.aws.messaging.listener.SqsMessageDeletionPolicy; +import org.springframework.cloud.aws.messaging.listener.annotation.SqsListener; +import org.springframework.messaging.handler.annotation.Headers; +import org.springframework.messaging.handler.annotation.Payload; +import org.springframework.stereotype.Component; +import sopt.org.umbba.common.sqs.MessageType; +import sopt.org.umbba.common.sqs.MessageUtils; +import sopt.org.umbba.common.sqs.dto.FCMPushRequestDto; +import sopt.org.umbba.common.sqs.dto.FirebaseDto; +import sopt.org.umbba.common.sqs.dto.SlackDto; +import sopt.org.umbba.notification.service.fcm.FCMService; +import sopt.org.umbba.notification.service.slack.SlackApi; + +import javax.websocket.SendResult; +import java.util.Map; + +/** + * 큐 대기열에 있는 메시지 목록을 조회하여 받아오는(pull) 역할 + * + */ +@Slf4j +@Component +@RequiredArgsConstructor +public class SqsConsumer { + + private final ObjectMapper objectMapper; + private final FCMService fcmService; + private final SlackApi slackApi; + private static final String SQS_CONSUME_LOG_MESSAGE = + "====> [SQS Queue Response]\n" + "info: %s\n" + "header: %s\n"; + + + // SQS로부터 메시지를 받는 Listener | 메시지를 받은 이후의 삭제 정책을 NEVER로 지정 + // -> 절대 삭제 요청을 보내지 않고, ack 메서드를 호출할 때 삭제 요청을 보냄 + @SqsListener(value = "${cloud.aws.sqs.notification.name}", deletionPolicy = SqsMessageDeletionPolicy.NEVER) + public void consume(@Payload String payload, @Headers Map headers, Acknowledgment ack) { + try { + log.info(MessageUtils.generate(SQS_CONSUME_LOG_MESSAGE, payload, headers)); + + switch (headers.get(MessageType.MESSAGE_TYPE_HEADER)) { + + case MessageType.FIREBASE: + FCMPushRequestDto request = objectMapper.readValue(payload, FCMPushRequestDto.class); + fcmService.pushAlarm(request, 1L); // TODO userId 를 넘겨주는 방식 대신 어떻게 유저 식별할지? + break; + + case MessageType.SLACK: + SlackDto slackDto = objectMapper.readValue(payload, SlackDto.class); + slackApi.sendAlert(slackDto.getError(), slackDto.getRequestMethod(), slackDto.getRequestURI()); + break; + } + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + ack.acknowledge(); + } + +} \ No newline at end of file diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java index a3267b05..bc7e7e67 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java @@ -29,7 +29,7 @@ import sopt.org.umbba.domain.domain.user.User; import sopt.org.umbba.domain.domain.user.repository.UserRepository; import sopt.org.umbba.notification.service.fcm.dto.FCMMessage; -import sopt.org.umbba.notification.service.fcm.dto.FCMPushRequestDto; +import sopt.org.umbba.common.sqs.dto.FCMPushRequestDto; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/slack/SlackApi.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/slack/SlackApi.java index 3f139dc2..22249112 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/slack/SlackApi.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/slack/SlackApi.java @@ -32,7 +32,7 @@ public class SlackApi { // Slack으로 알림 보내기 - public void sendAlert(Exception error, HttpServletRequest request) throws IOException { + public void sendAlert(Exception error, String requestMethod, String requestURI) throws IOException { // 현재 프로파일이 특정 프로파일이 아니면 알림보내지 않기 // if (!env.getActiveProfiles()[0].equals("set1")) { @@ -40,7 +40,7 @@ public void sendAlert(Exception error, HttpServletRequest request) throws IOExce // } // 메시지 내용인 LayoutBlock List 생성 - List layoutBlocks = generateLayoutBlock(error, request); + List layoutBlocks = generateLayoutBlock(error, requestMethod, requestURI); // 슬랙의 send API과 webhookURL을 통해 생성한 메시지 내용 전송 Slack.getInstance().send(webhookUrl, WebhookPayloads @@ -54,13 +54,13 @@ public void sendAlert(Exception error, HttpServletRequest request) throws IOExce } // 전체 메시지가 담긴 LayoutBlock 생성 - private List generateLayoutBlock(Exception error, HttpServletRequest request) { + private List generateLayoutBlock(Exception error, String requestMethod, String requestURI) { return Blocks.asBlocks( getHeader("서버 측 오류로 예상되는 예외 상황이 발생하였습니다."), Blocks.divider(), getSection(generateErrorMessage(error)), Blocks.divider(), - getSection(generateErrorPointMessage(request)), + getSection(generateErrorPointMessage(requestMethod, requestURI)), Blocks.divider(), // 이슈 생성을 위해 프로젝트의 Issue URL을 입력하여 바로가기 링크를 생성 getSection("") @@ -77,11 +77,11 @@ private String generateErrorMessage(Exception error) { } // HttpServletRequest를 사용하여 예외발생 요청에 대한 정보 메시지 생성 - private String generateErrorPointMessage(HttpServletRequest request) { + private String generateErrorPointMessage(String requestMethod, String requestURI) { sb.setLength(0); sb.append("*[🧾세부정보]*" + NEW_LINE); - sb.append("Request URL : " + request.getRequestURL().toString() + NEW_LINE); - sb.append("Request Method : " + request.getMethod() + NEW_LINE); + sb.append("Request URL : " + requestURI + NEW_LINE); + sb.append("Request Method : " + requestMethod + NEW_LINE); sb.append("Request Time : " + new Date() + NEW_LINE); return sb.toString(); From b0c0f084b4ece251e1cf126157ef1389450cff74 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Fri, 11 Aug 2023 15:46:18 +0900 Subject: [PATCH 18/27] =?UTF-8?q?[FEAT]=20Notification=20=EC=84=9C?= =?UTF-8?q?=EB=B9=84=EC=8A=A4=20API=20=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=B2=98=EB=A6=AC=20#87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notification/NotificationService.java | 14 +++++++++++++ .../config/sqs/consumer/SqsConsumer.java | 2 +- .../service/fcm/FCMController.java | 21 ++++++++++++------- .../notification/service/fcm/FCMService.java | 11 ++++------ 4 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java new file mode 100644 index 00000000..1f6b9341 --- /dev/null +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java @@ -0,0 +1,14 @@ +package sopt.org.umbba.api.service.notification; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * SQS 대기열로 알림 메시지를 추가 + */ +@RequiredArgsConstructor +@Service +@Transactional +public class NotificationService { +} diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java index 8fce5aa0..c55a1309 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/config/sqs/consumer/SqsConsumer.java @@ -48,7 +48,7 @@ public void consume(@Payload String payload, @Headers Map header case MessageType.FIREBASE: FCMPushRequestDto request = objectMapper.readValue(payload, FCMPushRequestDto.class); - fcmService.pushAlarm(request, 1L); // TODO userId 를 넘겨주는 방식 대신 어떻게 유저 식별할지? + fcmService.pushAlarm(request); // TODO userId 를 넘겨주는 방식 대신 어떻게 유저 식별할지? break; case MessageType.SLACK: diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMController.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMController.java index 69d0cb32..5d65b1a9 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMController.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMController.java @@ -1,10 +1,17 @@ package sopt.org.umbba.notification.service.fcm; import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; +import sopt.org.umbba.common.exception.SuccessType; +import sopt.org.umbba.common.exception.dto.ApiResponse; +import sopt.org.umbba.common.sqs.dto.FCMPushRequestDto; import sopt.org.umbba.notification.service.fcm.FCMService; import sopt.org.umbba.notification.service.scheduler.FCMScheduler; +import java.io.IOException; +import java.security.Principal; + @RestController @RequestMapping("/alarm") @RequiredArgsConstructor @@ -18,11 +25,11 @@ public class FCMController { * 새로운 질문이 도착했음을 알리는 푸시 알림 활성화 API * 실제로는 초대 받는측의 온보딩이 완료되었을 때 호출됨 */ - /*@PostMapping("/qna") + @PostMapping("/qna") @ResponseStatus(HttpStatus.OK) public ApiResponse sendTopicScheduledTest() { return ApiResponse.success(SuccessType.PUSH_ALARM_PERIODIC_SUCCESS, fcmScheduler.pushTodayQna()); - }*/ + } /** * 장난용 푸시 알림 활성화 API @@ -37,21 +44,21 @@ public ApiResponse sendTopicScheduledTest() { /** * 헤더와 바디를 직접 만들어 알림을 전송하는 테스트용 API (상대 답변 알람 전송에 사용) */ - /*@PostMapping + @PostMapping @ResponseStatus(HttpStatus.OK) public ApiResponse sendNotificationByToken(@RequestBody FCMPushRequestDto request, Principal principal) throws IOException { - return ApiResponse.success(SuccessType.PUSH_ALARM_SUCCESS, fcmService.pushAlarm(request, JwtProvider.getUserFromPrincial(principal))); - }*/ + return ApiResponse.success(SuccessType.PUSH_ALARM_SUCCESS, fcmService.pushAlarm(request)); + } /** * 동시에 여러 사람에게 푸시 알림을 보내보는 테스트용 API (주기적 알람 전송에 사용) */ - /*@PostMapping("/parentchild") + @PostMapping("/parentchild") @ResponseStatus(HttpStatus.OK) public ApiResponse sendMultiScheduledTest() { return ApiResponse.success(SuccessType.PUSH_ALARM_SUCCESS, fcmService.multipleSendByToken(FCMPushRequestDto.sendTodayQna("section", "question") ,93L)); - }*/ + } } diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java index bc7e7e67..ce6cccf2 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java @@ -39,6 +39,9 @@ import java.util.List; import java.util.concurrent.ScheduledFuture; +/** + * 서버에서 파이어베이스로 전송이 잘 이루어지는지 테스트하기 위한 컨트롤러 + */ @Slf4j @Service @RequiredArgsConstructor @@ -121,13 +124,7 @@ String makeMessage(FCMPushRequestDto request, Long userId) throws FirebaseMessag // FCM Service에 메시지를 수신하는 함수 (헤더와 바디 직접 만들기) -> 상대 답변 알람 전송에 사용 @Transactional - public String pushAlarm(FCMPushRequestDto request, Long userId) throws IOException { - - // TODO 같은 Parentchild ID를 가진 User를 찾은 후, 이들에 대한 토큰 리스트로 동일한 알림 메시지 전송하도록 - User user = userRepository.findById(userId).orElseThrow( - () -> new CustomException(ErrorType.INVALID_USER) - ); - user.updateFcmToken(request.getTargetToken()); + public String pushAlarm(FCMPushRequestDto request) throws IOException { String message = makeMessage(request); sendPushMessage(message); From 865d05d97c474bde1bb5c1dcdd85228a7aa3ec48 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sat, 12 Aug 2023 17:48:20 +0900 Subject: [PATCH 19/27] =?UTF-8?q?[CHORE]=20=EC=84=9C=EB=B2=84=20=EC=9D=B4?= =?UTF-8?q?=EC=A4=91=ED=99=94=EB=A5=BC=20=EC=9C=84=ED=95=9C=20CI/CD=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{CD.yml => api-CD.yml} | 46 ++++--- .github/workflows/{gradle.yml => api-CI.yml} | 25 +++- .github/workflows/notification-CD.yml | 121 ++++++++++++++++++ .github/workflows/notification-CI.yml | 84 ++++++++++++ scripts/deploy.sh | 85 ------------ scripts/umbba-api/appspec.yml | 22 ++++ scripts/umbba-api/deploy.sh | 81 ++++++++++++ scripts/umbba-api/switch.sh | 30 +++++ .../umbba-notification/appspec.yml | 6 +- scripts/umbba-notification/deploy.sh | 14 ++ 10 files changed, 404 insertions(+), 110 deletions(-) rename .github/workflows/{CD.yml => api-CD.yml} (76%) rename .github/workflows/{gradle.yml => api-CI.yml} (78%) create mode 100644 .github/workflows/notification-CD.yml create mode 100644 .github/workflows/notification-CI.yml delete mode 100644 scripts/deploy.sh create mode 100644 scripts/umbba-api/appspec.yml create mode 100644 scripts/umbba-api/deploy.sh create mode 100644 scripts/umbba-api/switch.sh rename appspec.yml => scripts/umbba-notification/appspec.yml (69%) create mode 100644 scripts/umbba-notification/deploy.sh diff --git a/.github/workflows/CD.yml b/.github/workflows/api-CD.yml similarity index 76% rename from .github/workflows/CD.yml rename to .github/workflows/api-CD.yml index dd93a10c..c1c03d14 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/api-CD.yml @@ -1,10 +1,22 @@ # 워크플로우의 이름 지정 -name: Umbba-Server CD +name: Umbba API Server CD # 해당 workflow가 언제 실행될 것인지에 대한 트리거를 지정 on: push: - branches: [ develop ] # develop branch로 push 될 때 실행됩니다. + branches: [ "develop" ] + paths: + - umbba-api/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** + pull_request: + branches: [ "develop" ] + paths: + - umbba-api/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** env: S3_BUCKET_NAME: umbba-storage @@ -37,7 +49,7 @@ jobs: aws-region: ap-northeast-2 # 3) 환경변수 파일 생성 - - name: make application.yaml 파일 생성 + - name: make application.yml 파일 생성 run: | # application.yml 파일 생성 cd ./src/main/resources @@ -51,14 +63,14 @@ jobs: # 생성된 파일 확인 cat ./application.yml + #################################### + # FCM secret key 폴더 생성 mkdir ./firebase cd ./firebase aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . - - cat umbba-fcm-firebase-adminsdk.json - + shell: bash # 이 워크플로우는 gradle build @@ -66,7 +78,7 @@ jobs: run: chmod +x gradlew - name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외) - run: ./gradlew build -x test + run: ./gradlew umbba-api:bootJar -x test # 디렉토리 생성 - name: Make Directory @@ -74,19 +86,15 @@ jobs: # Jar 파일 복사 - name: Copy Jar - run: cp ./build/libs/*.jar ./deploy + run: cp ./umbba-api/build/libs/*.jar ./deploy # run: cp -r src/main/* ./deploy - # appspec.yml 파일 복사 - - name: Copy appspec.yml - run: cp appspec.yml ./deploy - - # script files 복사 - - name: Copy script - run: cp ./scripts/*.sh ./deploy + # appspec.yml, script files 파일 복사 + - name: Copy files + run: cp ./scripts/umbba-api/* ./deploy - name: Make zip file - run: zip -r ./umbba_server.zip ./deploy + run: zip -r ./umbba-api.zip ./deploy shell: bash - name: Configure AWS credentials @@ -97,7 +105,7 @@ jobs: aws-region: ap-northeast-2 - name: Upload to S3 - run: aws s3 cp --region ap-northeast-2 ./umbba_server.zip s3://$S3_BUCKET_NAME/ + run: aws s3 cp --region ap-northeast-2 ./umbba-api.zip s3://$S3_BUCKET_NAME/ # Deploy - name: Deploy @@ -107,7 +115,7 @@ jobs: run: aws deploy create-deployment --application-name umbba-server-codedeploy - --deployment-group-name umbba-server-codedeploy-group + --deployment-group-name umbba-api-server-codedeploy-group --file-exists-behavior OVERWRITE - --s3-location bucket=umbba-storage,bundleType=zip,key=umbba_server.zip + --s3-location bucket=umbba-storage,bundleType=zip,key=umbba-api.zip --region ap-northeast-2 diff --git a/.github/workflows/gradle.yml b/.github/workflows/api-CI.yml similarity index 78% rename from .github/workflows/gradle.yml rename to .github/workflows/api-CI.yml index 72c66fe0..777af610 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/api-CI.yml @@ -11,13 +11,23 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle -name: Umbba-Server CI +name: Umbba API Server CI on: push: branches: [ "develop" ] + paths: + - umbba-api/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** pull_request: branches: [ "develop" ] + paths: + - umbba-api/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** permissions: contents: read @@ -41,7 +51,7 @@ jobs: distribution: 'temurin' # 3) 환경변수 파일 생성 - - name: make application.yaml 파일 생성 + - name: make application.yml 파일 생성 run: | ## create application.yml cd ./src/main/resources @@ -55,6 +65,15 @@ jobs: # application.yml 파일 확인 cat ./application.yml + + #################################### + + # FCM secret key 폴더 생성 + mkdir ./firebase + cd ./firebase + + aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . + shell: bash # 이 워크플로우는 gradle build @@ -62,4 +81,4 @@ jobs: run: chmod +x gradlew - name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외) - run: ./gradlew build -x test + run: ./gradlew umbba-api:bootJar -x test diff --git a/.github/workflows/notification-CD.yml b/.github/workflows/notification-CD.yml new file mode 100644 index 00000000..ba1a3c1d --- /dev/null +++ b/.github/workflows/notification-CD.yml @@ -0,0 +1,121 @@ +# 워크플로우의 이름 지정 +name: Umbba Notification Server CD + +# 해당 workflow가 언제 실행될 것인지에 대한 트리거를 지정 +on: + push: + branches: [ "develop" ] + paths: + - umbba-notification/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** + pull_request: + branches: [ "develop" ] + paths: + - umbba-notification/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** + +env: + S3_BUCKET_NAME: umbba-storage + +jobs: + build: + name: Code deployment + + # 실행 환경 + runs-on: ubuntu-latest + + steps: + + # 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 + - name: checkout + uses: actions/checkout@v3 + + # 2) JDK 11버전 설치, 다른 JDK 버전을 사용하다면 수정 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} + aws-region: ap-northeast-2 + + # 3) 환경변수 파일 생성 + - name: make application.yml 파일 생성 + run: | + # application.yml 파일 생성 + cd ./src/main/resources + rm application.yaml + + touch ./application.yml + + # GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기 + echo "${{ secrets.UMBBA_SECRET }}" >> ./application.yml + + # 생성된 파일 확인 + cat ./application.yml + + #################################### + + # FCM secret key 폴더 생성 + mkdir ./firebase + cd ./firebase + + aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . + + shell: bash + + # 이 워크플로우는 gradle build + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외) + run: ./gradlew umbba-notification:bootJar -x test + + # 디렉토리 생성 + - name: Make Directory + run: mkdir -p deploy + + # Jar 파일 복사 + - name: Copy Jar + run: cp ./umbba-notification/build/libs/*.jar ./deploy + # run: cp -r src/main/* ./deploy + + # appspec.yml, script files 파일 복사 + - name: Copy files + run: cp ./scripts/umbba-notification/* ./deploy + + - name: Make zip file + run: zip -r ./umbba-notification.zip ./deploy + shell: bash + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} + aws-region: ap-northeast-2 + + - name: Upload to S3 + run: aws s3 cp --region ap-northeast-2 ./umbba-notification.zip s3://$S3_BUCKET_NAME/ + + # Deploy + - name: Deploy + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} + run: + aws deploy create-deployment + --application-name umbba-server-codedeploy + --deployment-group-name umbba-notification-server-codedeploy-group + --file-exists-behavior OVERWRITE + --s3-location bucket=umbba-storage,bundleType=zip,key=umbba-notification.zip + --region ap-northeast-2 diff --git a/.github/workflows/notification-CI.yml b/.github/workflows/notification-CI.yml new file mode 100644 index 00000000..08a931aa --- /dev/null +++ b/.github/workflows/notification-CI.yml @@ -0,0 +1,84 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Umbba Notification Server CI + +on: + push: + branches: [ "develop" ] + paths: + - umbba-notification/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** + pull_request: + branches: [ "develop" ] + paths: + - umbba-notification/** + - umbba-domain/** + - umbba-common/** + - umbba-external/** + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + + # 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 + - name: checkout + uses: actions/checkout@v3 + + # 2) JDK 11버전 설치, 다른 JDK 버전을 사용하다면 수정 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + # 3) 환경변수 파일 생성 + - name: make application.yml 파일 생성 + run: | + ## create application.yml + cd ./src/main/resources + rm application.yaml + + # application.yml 파일 생성 + touch ./application.yml + + # GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기 + echo "${{ secrets.UMBBA_SECRET }}" >> ./application.yml + + # application.yml 파일 확인 + cat ./application.yml + + #################################### + + # FCM secret key 폴더 생성 + mkdir ./firebase + cd ./firebase + + aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . + + shell: bash + + # 이 워크플로우는 gradle build + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외) + run: ./gradlew umbba-notification:bootJar -x test diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100644 index 8b22c10e..00000000 --- a/scripts/deploy.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -BUILD_PATH=$(ls /home/ubuntu/app/umbbaServer-0.0.1-SNAPSHOT.jar) -JAR_NAME=$(basename $BUILD_PATH) -echo "> build 파일명: $JAR_NAME" - -echo "> build 파일 복사" -DEPLOY_PATH=/home/ubuntu/app/nonstop/jar/ -cp $BUILD_PATH $DEPLOY_PATH - -echo "> 현재 구동중인 Set 확인" -CURRENT_PROFILE=$(curl -s http://localhost/profile) -echo "> $CURRENT_PROFILE" - -# 쉬고 있는 set 찾기: set1이 사용중이면 set2가 쉬고 있고, 반대면 set1이 쉬고 있음 -if [ $CURRENT_PROFILE == set1 ] -then - IDLE_PROFILE=set2 - IDLE_PORT=8082 -elif [ $CURRENT_PROFILE == set2 ] -then - IDLE_PROFILE=set1 - IDLE_PORT=8081 -else - echo "> 일치하는 Profile이 없습니다. Profile: $CURRENT_PROFILE" - echo "> set1을 할당합니다. IDLE_PROFILE: set1" - IDLE_PROFILE=set1 - IDLE_PORT=8081 -fi - -echo "> application.jar 교체" -IDLE_APPLICATION=$IDLE_PROFILE-Team-Umbba.jar -IDLE_APPLICATION_PATH=$DEPLOY_PATH$IDLE_APPLICATION - -ln -Tfs $DEPLOY_PATH$JAR_NAME $IDLE_APPLICATION_PATH - -echo "> $IDLE_PROFILE 에서 구동중인 애플리케이션 pid 확인" -IDLE_PID=$(pgrep -f $IDLE_APPLICATION) - -if [ -z $IDLE_PID ] -then - echo "> 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다." -else - echo "> kill -15 $IDLE_PID" - kill -15 $IDLE_PID - echo wait 10 seconds... - sleep 10 - echo wait complete! - -fi - -echo "> $IDLE_PROFILE 배포" -nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=$IDLE_PROFILE $IDLE_APPLICATION_PATH >> /home/ubuntu/app/nohup.out 2>&1 & - -echo "> $IDLE_PROFILE 10초 후 Health check 시작" -echo "> curl -s http://localhost:$IDLE_PORT/health " -sleep 10 - -for retry_count in {1..10} -do - response=$(curl -s http://localhost:$IDLE_PORT/actuator/health) - up_count=$(echo $response | grep 'UP' | wc -l) - - if [ $up_count -ge 1 ] - then # $up_count >= 1 ("UP" 문자열이 있는지 검증) - echo "> Health check 성공" - break - else - echo "> Health check의 응답을 알 수 없거나 혹은 status가 UP이 아닙니다." - echo "> Health check: ${response}" - fi - - if [ $retry_count -eq 10 ] - then - echo "> Health check 실패. " - echo "> Nginx에 연결하지 않고 배포를 종료합니다." - exit 1 - fi - - echo "> Health check 연결 실패. 재시도..." - sleep 10 -done - -echo "> 스위칭" -sleep 10 -/home/ubuntu/app/nonstop/switch.sh diff --git a/scripts/umbba-api/appspec.yml b/scripts/umbba-api/appspec.yml new file mode 100644 index 00000000..0386a216 --- /dev/null +++ b/scripts/umbba-api/appspec.yml @@ -0,0 +1,22 @@ +version: 0.0 +os: linux + +files: + - source: / + destination: /home/ubuntu/api-server + overwrite: yes + +permissions: + - object: / + pattern: "**" + owner: ubuntu + group: ubuntu + +hooks: + AfterInstall: + - location: deploy.sh + timeout: 180 + runas: ubuntu + - location: switch.sh + timeout: 180 + runas: ubuntu \ No newline at end of file diff --git a/scripts/umbba-api/deploy.sh b/scripts/umbba-api/deploy.sh new file mode 100644 index 00000000..b1d1a0ae --- /dev/null +++ b/scripts/umbba-api/deploy.sh @@ -0,0 +1,81 @@ +NOW_TIME="$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)" + +BUILD_PATH=$(ls /home/ubuntu/api-server/umbba-api-0.0.1-SNAPSHOT.jar) +JAR_NAME=$(basename $BUILD_PATH) +echo "[$NOW_TIME] build 파일명: $JAR_NAME" + +echo "[$NOW_TIME] build 파일 복사" +DEPLOY_PATH=/home/ubuntu/api-server/nonstop/jar/ +cp $BUILD_PATH $DEPLOY_PATH + +echo "[$NOW_TIME] 현재 구동중인 Set 확인" +CURRENT_PROFILE=$(curl -s http://localhost/profile) +echo "[$NOW_TIME] $CURRENT_PROFILE" + +# 쉬고 있는 set 찾기: set1이 사용중이면 set2가 쉬고 있고, 반대면 set1이 쉬고 있음 +if [ $CURRENT_PROFILE == set1 ] +then + IDLE_PROFILE=set2 + IDLE_PORT=8082 +elif [ $CURRENT_PROFILE == set2 ] +then + IDLE_PROFILE=set1 + IDLE_PORT=8081 +else + echo "[$NOW_TIME] 일치하는 Profile이 없습니다. Profile: $CURRENT_PROFILE" + echo "[$NOW_TIME] set1을 할당합니다. IDLE_PROFILE: set1" + IDLE_PROFILE=set1 + IDLE_PORT=8081 +fi + +echo "[$NOW_TIME] application.jar 교체" +IDLE_APPLICATION=$IDLE_PROFILE-Umbba-API.jar +IDLE_APPLICATION_PATH=$DEPLOY_PATH$IDLE_APPLICATION + +ln -Tfs $DEPLOY_PATH$JAR_NAME $IDLE_APPLICATION_PATH + +echo "[$NOW_TIME] $IDLE_PROFILE 에서 구동중인 애플리케이션 pid 확인" +IDLE_PID=$(pgrep -f $IDLE_APPLICATION) + +if [ -z $IDLE_PID ] +then + echo "[$NOW_TIME] 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다." +else + echo "[$NOW_TIME] kill -15 $IDLE_PID" + kill -15 $IDLE_PID + sleep 10 +fi + +echo "[$NOW_TIME] $IDLE_PROFILE 배포" +nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=$IDLE_PROFILE $IDLE_APPLICATION_PATH >> /home/ubuntu/api-server/deploy.log 2>/home/ubuntu/api-server/deploy_err.log & + +################################################################## + +echo "[$NOW_TIME] $IDLE_PROFILE 10초 후 Health check 시작" +echo "[$NOW_TIME] curl -s http://localhost:$IDLE_PORT/health " +sleep 10 + +for retry_count in {1..10} +do + response=$(curl -s http://localhost:$IDLE_PORT/actuator/health) + up_count=$(echo $response | grep 'UP' | wc -l) + + if [ $up_count -ge 1 ] + then # $up_count >= 1 ("UP" 문자열이 있는지 검증) + echo "[$NOW_TIME] Health check 성공" + break + else + echo "[$NOW_TIME] Health check의 응답을 알 수 없거나 혹은 status가 UP이 아닙니다." + echo "[$NOW_TIME] Health check: ${response}" + fi + + if [ $retry_count -eq 10 ] + then + echo "[$NOW_TIME] Health check 실패. " + echo "[$NOW_TIME] Nginx에 연결하지 않고 배포를 종료합니다." + exit 1 + fi + + echo "[$NOW_TIME] Health check 연결 실패. 재시도..." + sleep 10 +done \ No newline at end of file diff --git a/scripts/umbba-api/switch.sh b/scripts/umbba-api/switch.sh new file mode 100644 index 00000000..31150cdd --- /dev/null +++ b/scripts/umbba-api/switch.sh @@ -0,0 +1,30 @@ +NOW_TIME="$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)" + +echo "[$NOW_TIME] 스위칭" +sleep 10 +#!/bin/bash +echo "[$NOW_TIME] 현재 구동중인 Port 확인" +CURRENT_PROFILE=$(curl -s http://localhost/profile) + +# 쉬고 있는 set 찾기: set1이 사용중이면 set2가 쉬고 있고, 반대면 set1이 쉬고 있음 +if [ $CURRENT_PROFILE == set1 ] +then + IDLE_PORT=8082 +elif [ $CURRENT_PROFILE == set2 ] +then + IDLE_PORT=8081 +else + echo "[$NOW_TIME] 일치하는 Profile이 없습니다. Profile: $CURRENT_PROFILE" + echo "[$NOW_TIME] 8081을 할당합니다." + IDLE_PORT=8081 +fi + +echo "[$NOW_TIME] 전환할 Port: $IDLE_PORT" +echo "[$NOW_TIME] Port 전환" +echo "[$NOW_TIME] set \$service_url http://127.0.0.1:${IDLE_PORT};" | sudo tee /etc/nginx/conf.d/service-url.inc + +PROXY_PORT=$(curl -s http://localhost/profile) +echo "[$NOW_TIME] Nginx Current Proxy Port: $PROXY_PORT" + +echo "[$NOW_TIME] Nginx Reload" +sudo service nginx reload \ No newline at end of file diff --git a/appspec.yml b/scripts/umbba-notification/appspec.yml similarity index 69% rename from appspec.yml rename to scripts/umbba-notification/appspec.yml index 44c46f6a..4a0bf554 100644 --- a/appspec.yml +++ b/scripts/umbba-notification/appspec.yml @@ -3,7 +3,7 @@ os: linux files: - source: / - destination: /home/ubuntu/app + destination: /home/ubuntu/notification-server overwrite: yes permissions: @@ -15,5 +15,5 @@ permissions: hooks: AfterInstall: - location: deploy.sh - timeout: 60 - runas: ubuntu + timeout: 180 + runas: ubuntu \ No newline at end of file diff --git a/scripts/umbba-notification/deploy.sh b/scripts/umbba-notification/deploy.sh new file mode 100644 index 00000000..0c27634a --- /dev/null +++ b/scripts/umbba-notification/deploy.sh @@ -0,0 +1,14 @@ +NOW_TIME="$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)" + +BUILD_PATH=/home/ubuntu/notification-server/umbba-notification-0.0.1-SNAPSHOT.jar +TARGET_PORT=8083 +TARGET_PID=$(lsof -Fp -i TCP:${TARGET_PORT} | grep -Po 'p[0-9]+' | grep -Po '[0-9]+') + +if [ ! -z ${TARGET_PID} ]; then + echo "[$NOW_TIME] Kill WAS running at ${TARGET_PORT}." >> /home/ubuntu/notification-server/deploy.log + sudo kill -15 ${TARGET_PID} +fi + +nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=notification $BUILD_PATH >> /home/ubuntu/notification-server/deploy.log 2>/home/ubuntu/notification-server/deploy_err.log & +echo "[$NOW_TIME] Now new WAS runs at ${TARGET_PORT}." >> /home/ubuntu/notification-server/deploy.log +exit 0 \ No newline at end of file From f2495ead38073adcf0323959a7d879f2b5164ba5 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sat, 12 Aug 2023 17:50:18 +0900 Subject: [PATCH 20/27] =?UTF-8?q?[FIX]=20EntityManager=20close=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20#88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/sopt/org/umbba/notification/service/fcm/FCMService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java index a3267b05..7ad5e459 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java @@ -233,6 +233,7 @@ public void schedulePushAlarm(String cronExpression, Long parentchildId) { log.info("스케줄링 작업 예약 내 addCount 후 count: {}", pc.getCount()); QnA todayQnA = parentchild.getQnaList().get(parentchild.getCount() - 1); + em.close(); log.info("\n Current QnA: {} \n Today QnA: {}", currentQnA.getId(), todayQnA.getId()); if (todayQnA == null) { From 60b1ea3b25a3d9d9df4977d70905e20c4830636b Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 12 Aug 2023 21:28:04 +0900 Subject: [PATCH 21/27] =?UTF-8?q?[ADD]=20develop=20=EB=B8=8C=EB=9E=9C?= =?UTF-8?q?=EC=B9=98=20hotfix=20=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=B0=98=EC=98=81=20#87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/umbbaServer/DBConnectionTest.java | 65 +++++++++++++++++++ .../java/sopt/org/umbbaServer/TestConfig.java | 20 ++++++ .../umbba/api/service/user/AuthService.java | 3 + umbba-api/src/main/resources/application.yaml | 10 ++- .../notification/service/fcm/FCMService.java | 2 + 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/test/java/sopt/org/umbbaServer/DBConnectionTest.java create mode 100644 src/test/java/sopt/org/umbbaServer/TestConfig.java diff --git a/src/test/java/sopt/org/umbbaServer/DBConnectionTest.java b/src/test/java/sopt/org/umbbaServer/DBConnectionTest.java new file mode 100644 index 00000000..310a26d7 --- /dev/null +++ b/src/test/java/sopt/org/umbbaServer/DBConnectionTest.java @@ -0,0 +1,65 @@ +package sopt.org.umbbaServer; + +import com.zaxxer.hikari.HikariDataSource; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.jdbc.datasource.DriverManagerDataSource; +import org.springframework.stereotype.Component; +import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.logging.Logger; + +@Slf4j +@SpringJUnitConfig(TestConfig.class) +@SpringBootTest +public class DBConnectionTest { + + private final String DB_URL = "jdbc:mysql://umbba-db.csqsqogfqnvj.ap-northeast-2.rds.amazonaws.com:3306/umbba_db?useSSL=true&useUnicode=true&serverTimezone=Asia/Seoul"; + private final String DB_USERNAME = "umbba_server"; + private final String DB_PASSWORD = "umbbaServer!"; + + + @Test + void dataSourceDriverManager() throws SQLException, InterruptedException { + //hikari pool 을 사용해서 커넥션 pooling + //DriverManagerSource - 항상 새로운 커넥션을 획득 + DriverManagerDataSource dataSource = new DriverManagerDataSource(DB_URL, DB_USERNAME, DB_PASSWORD); + useDataSource(dataSource); + + //커넥션에서 커넥션 풀이 생성되는 걸 보기위해 + Thread.sleep(1000); + } + + @Test + void dataSourceConnectionPool() throws SQLException, InterruptedException { + //DriverManagerSource - 항상 새로운 커넥션을 획득 + + //커넥션 풀링: HikariProxyConnection(Proxy) -> JdbcConnection(Target) + HikariDataSource dataSource = new HikariDataSource(); + dataSource.setJdbcUrl(DB_URL); + dataSource.setUsername(DB_USERNAME); + dataSource.setPassword(DB_PASSWORD); + + dataSource.setMaximumPoolSize(10); + dataSource.setPoolName("MyPool"); + + useDataSource(dataSource); + + //커넥션에서 커넥션 풀이 생성되는 걸 보기위해 + Thread.sleep(1000); + + } + + + private void useDataSource(DataSource dataSource) throws SQLException { + Connection conn1 = DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD); + Connection conn2 = DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD); + log.info("connection={}, class={}", conn1, conn1.getClass()); + log.info("connection={}, class={}", conn2, conn2.getClass()); + } +} diff --git a/src/test/java/sopt/org/umbbaServer/TestConfig.java b/src/test/java/sopt/org/umbbaServer/TestConfig.java new file mode 100644 index 00000000..c59d67e9 --- /dev/null +++ b/src/test/java/sopt/org/umbbaServer/TestConfig.java @@ -0,0 +1,20 @@ +package sopt.org.umbbaServer; + +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.jdbc.datasource.DriverManagerDataSource; + +import javax.sql.DataSource; + +@TestConfiguration +public class TestConfig { + + private final String DB_URL = "jdbc:mysql://umbba-db.csqsqogfqnvj.ap-northeast-2.rds.amazonaws.com:3306/umbba_db?useSSL=true&useUnicode=true&serverTimezone=Asia/Seoul"; + private final String DB_USERNAME = "umbba_server"; + private final String DB_PASSWORD = "umbbaServer!"; + + @Bean + public DataSource dataSource() { + return new DriverManagerDataSource(DB_URL, DB_USERNAME, DB_PASSWORD); + } +} diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/service/user/AuthService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/AuthService.java index 64a51721..beb26084 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/service/user/AuthService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/user/AuthService.java @@ -2,6 +2,7 @@ import feign.FeignException; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import sopt.org.umbba.api.config.auth.UserAuthentication; @@ -21,6 +22,7 @@ import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; +@Slf4j @Service @RequiredArgsConstructor @Transactional(readOnly = true) @@ -65,6 +67,7 @@ public UserLoginResponseDto login(String socialAccessToken, SocialLoginRequestDt // 클라이언트 요청에 따라 FCM 토큰을 로그인할 때마다 업데이트 하도록 변경 loginUser.updateFcmToken(request.getFcmToken()); + log.info("🔮{}의 JWT Access Token: {}", loginUser.getUsername(), tokenDto.getAccessToken()); return UserLoginResponseDto.of(loginUser, tokenDto.getAccessToken()); } diff --git a/umbba-api/src/main/resources/application.yaml b/umbba-api/src/main/resources/application.yaml index 8e325888..5445de51 100644 --- a/umbba-api/src/main/resources/application.yaml +++ b/umbba-api/src/main/resources/application.yaml @@ -24,6 +24,12 @@ spring: url: ${db-url} username: ${db-user} password: ${db-pwd} + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 2000 # default: 0(이용X) jpa: show-sql: false hibernate: @@ -68,6 +74,8 @@ logging: type: descriptor: sql: debug + com.zaxxer.hikari.pool.HikariPool: debug + server: - port: 9092 + port: 9091 \ No newline at end of file diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java index ce6cccf2..1f880315 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java @@ -251,6 +251,8 @@ public void schedulePushAlarm(String cronExpression, Long parentchildId) { } } catch (PessimisticLockingFailureException | PessimisticLockException e) { transactionManager.rollback(transactionStatus); + } finally { + em.close(); } // 현재 실행중인 쓰레드 확인 From fca32eadb035fc9fda74b6aa0e27396a6527e0df Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 12 Aug 2023 23:20:35 +0900 Subject: [PATCH 22/27] =?UTF-8?q?[FEAT]=20SQS=20=EB=8C=80=EA=B8=B0?= =?UTF-8?q?=EC=97=B4=EC=9D=84=20=ED=86=B5=ED=95=9C=20=ED=91=B8=EC=8B=9C?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EA=B8=B0=EB=8A=A5=20#87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/config/sqs/producer/SqsProducer.java | 4 +-- .../api/controller/health/DemoController.java | 12 +++++++ .../notification/NotificationService.java | 36 +++++++++++++++++++ .../org/umbba/api/service/qna/QnAService.java | 12 ++++--- umbba-api/src/main/resources/application.yaml | 12 +++---- .../src/main/resources/application.yaml | 10 +++++- 6 files changed, 72 insertions(+), 14 deletions(-) diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java index 9696ced4..5c8b42df 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/config/sqs/producer/SqsProducer.java @@ -46,8 +46,8 @@ public void produce(MessageDto message) { try { SendMessageRequest request = new SendMessageRequest(NOTIFICATION_URL, objectMapper.writeValueAsString(message)) - .withMessageGroupId(GROUP_ID) - .withMessageDeduplicationId(GROUP_ID) // TODO UUID Random String으로 변경 +// .withMessageGroupId(GROUP_ID) +// .withMessageDeduplicationId(UUID.randomUUID().toString()) // TODO UUID Random String으로 변경 .withMessageAttributes(createMessageAttributes(message.getType())); amazonSqs.sendMessage(request); diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/DemoController.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/DemoController.java index e721786b..c278c058 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/DemoController.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/health/DemoController.java @@ -3,15 +3,19 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; +import sopt.org.umbba.api.config.sqs.producer.SqsProducer; +import sopt.org.umbba.api.service.notification.NotificationService; import sopt.org.umbba.api.service.qna.QnAService; import sopt.org.umbba.common.exception.SuccessType; import sopt.org.umbba.common.exception.dto.ApiResponse; +import sopt.org.umbba.common.sqs.dto.FCMPushRequestDto; @RestController @RequiredArgsConstructor public class DemoController { private final QnAService qnAService; + private final NotificationService notificationService; /** * 데모데이 테스트용 QnA리스트 세팅 API @@ -44,4 +48,12 @@ public ApiResponse demoQnA(@PathVariable final Long userId) { return ApiResponse.success(SuccessType.TEST_SUCCESS); } + @PatchMapping("/demo/qna/alarm/{userId}") + @ResponseStatus(HttpStatus.OK) + public ApiResponse qnaAnswerAlarm(@PathVariable final Long userId, @RequestBody String question) { + + notificationService.pushOpponentReply(question, userId); + return ApiResponse.success(SuccessType.TEST_SUCCESS); + } + } diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java index 1f6b9341..80c8c33e 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/notification/NotificationService.java @@ -1,14 +1,50 @@ package sopt.org.umbba.api.service.notification; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import sopt.org.umbba.api.config.sqs.producer.SqsProducer; +import sopt.org.umbba.common.exception.ErrorType; +import sopt.org.umbba.common.exception.model.CustomException; +import sopt.org.umbba.common.sqs.dto.FCMPushRequestDto; +import sopt.org.umbba.common.sqs.dto.SlackDto; +import sopt.org.umbba.domain.domain.user.User; +import sopt.org.umbba.domain.domain.user.repository.UserRepository; + +import java.io.IOException; /** * SQS 대기열로 알림 메시지를 추가 */ +@Slf4j @RequiredArgsConstructor @Service @Transactional public class NotificationService { + + private final SqsProducer sqsProducer; + private final UserRepository userRepository; + + public void pushOpponentReply(String question, Long userId) { + + // 상대 측 유저의 FCM 토큰 찾기 + User user = userRepository.findById(userId).orElseThrow( + () -> new CustomException(ErrorType.INVALID_USER) + ); + + log.info("상대방 답변 완료!"); + sqsProducer.produce(FCMPushRequestDto.sendOpponentReply(user.getFcmToken(), question)); + + /* try { + log.info("상대방 답변 완료!"); + sqsProducer.produce(FCMPushRequestDto.sendOpponentReply(user.getFcmToken(), question)); + } catch (IOException e) { + log.error("푸시메시지 전송 실패 - IOException: {}", e.getMessage()); + throw new CustomException(ErrorType.FAIL_TO_SEND_PUSH_ALARM); + } catch (FirebaseMessagingException e) { + log.error("푸시메시지 전송 실패 - FirebaseMessagingException: {}", e.getMessage()); + throw new CustomException(ErrorType.FAIL_TO_SEND_PUSH_ALARM); + }*/ + } } diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java index d1d5b393..f9812b96 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java @@ -4,8 +4,10 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import sopt.org.umbba.api.config.sqs.producer.SqsProducer; import sopt.org.umbba.api.controller.qna.dto.request.TodayAnswerRequestDto; import sopt.org.umbba.api.controller.qna.dto.response.*; +import sopt.org.umbba.api.service.notification.NotificationService; import sopt.org.umbba.common.exception.ErrorType; import sopt.org.umbba.common.exception.model.CustomException; import sopt.org.umbba.domain.domain.parentchild.Parentchild; @@ -41,7 +43,7 @@ public class QnAService { private final QuestionRepository questionRepository; private final UserRepository userRepository; private final ParentchildDao parentchildDao; -// private final FCMService fcmService; //TODO ⭐️SQS로 변경 + private final NotificationService notificationService; public TodayQnAResponseDto getTodayQnA(Long userId) { @@ -82,12 +84,12 @@ public void answerTodayQuestion(Long userId, TodayAnswerRequestDto request) { if (myUser.isMeChild()) { todayQnA.saveChildAnswer(request.getAnswer()); - //TODO ⭐️SQS로 변경 -// fcmService.pushOpponentReply(todayQnA.getQuestion().getParentQuestion(), opponentUser.getId()); + notificationService.pushOpponentReply(todayQnA.getQuestion().getChildQuestion(), opponentUser.getId()); +// fcmService.pushOpponentReply(todayQnA.getQuestion().getChildQuestion(), opponentUser.getId()); } else { todayQnA.saveParentAnswer(request.getAnswer()); - //TODO ⭐️SQS로 변경 -// fcmService.pushOpponentReply(todayQnA.getQuestion().getChildQuestion(), opponentUser.getId()); + notificationService.pushOpponentReply(todayQnA.getQuestion().getParentQuestion(), opponentUser.getId()); +// fcmService.pushOpponentReply(todayQnA.getQuestion().getParentQuestion(), opponentUser.getId()); } } diff --git a/umbba-api/src/main/resources/application.yaml b/umbba-api/src/main/resources/application.yaml index 5445de51..ef4e222a 100644 --- a/umbba-api/src/main/resources/application.yaml +++ b/umbba-api/src/main/resources/application.yaml @@ -24,12 +24,12 @@ spring: url: ${db-url} username: ${db-user} password: ${db-pwd} - hikari: - pool-name: Hikari 커넥션 풀 # Pool - connection-timeout: 30000 # 30초(default: 30초) - maximum-pool-size: 10 # default: 10개 - max-lifetime: 600000 # 10분(default: 30분) - leak-detection-threshold: 2000 # default: 0(이용X) + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 2000 # default: 0(이용X) jpa: show-sql: false hibernate: diff --git a/umbba-notification/src/main/resources/application.yaml b/umbba-notification/src/main/resources/application.yaml index 63ac9f11..93c96e4d 100644 --- a/umbba-notification/src/main/resources/application.yaml +++ b/umbba-notification/src/main/resources/application.yaml @@ -24,6 +24,12 @@ spring: url: ${db-url} username: ${db-user} password: ${db-pwd} + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 2000 # default: 0(이용X) jpa: show-sql: false hibernate: @@ -68,6 +74,8 @@ logging: type: descriptor: sql: debug + com.zaxxer.hikari.pool.HikariPool: debug + server: - port: 9091 \ No newline at end of file + port: 9092 \ No newline at end of file From a0d103652619077b27ddf3a2b87faf2b0f63824d Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 12 Aug 2023 23:32:29 +0900 Subject: [PATCH 23/27] =?UTF-8?q?[CHORE]=20500=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=95=B8=EB=93=A4=EB=A7=81=20=EC=A3=BC=EC=84=9D=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../advice/ControllerExceptionAdvice.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java index 57e57ec4..b8f4bdc0 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java @@ -2,9 +2,13 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.dao.DataIntegrityViolationException; +import org.springframework.dao.IncorrectResultSizeDataAccessException; +import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.orm.jpa.JpaSystemException; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.FieldError; @@ -15,6 +19,7 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; +import org.springframework.web.util.NestedServletException; import sopt.org.umbba.common.exception.ErrorType; import sopt.org.umbba.common.exception.dto.ApiResponse; import sopt.org.umbba.common.exception.model.CustomException; @@ -24,6 +29,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import java.util.NoSuchElementException; @Slf4j @RestControllerAdvice @@ -99,7 +105,7 @@ protected ApiResponse handleException(final Exception e, final HttpSe return ApiResponse.error(ErrorType.INTERNAL_SERVER_ERROR, e); } - /*@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(IllegalArgumentException.class) public ApiResponse handlerIllegalArgumentException(final IllegalArgumentException e) { return ApiResponse.error(ErrorType.INTERNAL_SERVER_ERROR, e); @@ -124,11 +130,11 @@ protected ApiResponse handlerIndexOutOfBoundsException(final IndexOut return ApiResponse.error(ErrorType.INDEX_OUT_OF_BOUNDS, e); } - *//*@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + /*@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(UnknownClassException.class) protected ApiResponse handlerUnknownClassException(final UnknownClassException e) { return ApiResponse.error(ErrorType.JWT_SERIALIZE, e); - }*//* + }*/ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(NoSuchElementException.class) @@ -170,7 +176,7 @@ public ApiResponse handlerJpaSystemException(final JpaSystemException @ExceptionHandler(NullPointerException.class) public ApiResponse handlerNullPointerException(final NullPointerException e) { return ApiResponse.error(ErrorType.NULL_POINTER_ERROR, e); - }*/ + } /** From bd7512195b52d7af7fa4e8c26139e1e96f329405 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 12 Aug 2023 23:41:52 +0900 Subject: [PATCH 24/27] =?UTF-8?q?[CHORE]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=ED=8C=8C=EC=9D=BC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/umbbaServer/DBConnectionTest.java | 65 ------------------- .../java/sopt/org/umbbaServer/TestConfig.java | 20 ------ .../org/umbba/api/service/qna/QnAService.java | 2 +- 3 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 src/test/java/sopt/org/umbbaServer/DBConnectionTest.java delete mode 100644 src/test/java/sopt/org/umbbaServer/TestConfig.java diff --git a/src/test/java/sopt/org/umbbaServer/DBConnectionTest.java b/src/test/java/sopt/org/umbbaServer/DBConnectionTest.java deleted file mode 100644 index 310a26d7..00000000 --- a/src/test/java/sopt/org/umbbaServer/DBConnectionTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package sopt.org.umbbaServer; - -import com.zaxxer.hikari.HikariDataSource; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.jdbc.datasource.DriverManagerDataSource; -import org.springframework.stereotype.Component; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.util.logging.Logger; - -@Slf4j -@SpringJUnitConfig(TestConfig.class) -@SpringBootTest -public class DBConnectionTest { - - private final String DB_URL = "jdbc:mysql://umbba-db.csqsqogfqnvj.ap-northeast-2.rds.amazonaws.com:3306/umbba_db?useSSL=true&useUnicode=true&serverTimezone=Asia/Seoul"; - private final String DB_USERNAME = "umbba_server"; - private final String DB_PASSWORD = "umbbaServer!"; - - - @Test - void dataSourceDriverManager() throws SQLException, InterruptedException { - //hikari pool 을 사용해서 커넥션 pooling - //DriverManagerSource - 항상 새로운 커넥션을 획득 - DriverManagerDataSource dataSource = new DriverManagerDataSource(DB_URL, DB_USERNAME, DB_PASSWORD); - useDataSource(dataSource); - - //커넥션에서 커넥션 풀이 생성되는 걸 보기위해 - Thread.sleep(1000); - } - - @Test - void dataSourceConnectionPool() throws SQLException, InterruptedException { - //DriverManagerSource - 항상 새로운 커넥션을 획득 - - //커넥션 풀링: HikariProxyConnection(Proxy) -> JdbcConnection(Target) - HikariDataSource dataSource = new HikariDataSource(); - dataSource.setJdbcUrl(DB_URL); - dataSource.setUsername(DB_USERNAME); - dataSource.setPassword(DB_PASSWORD); - - dataSource.setMaximumPoolSize(10); - dataSource.setPoolName("MyPool"); - - useDataSource(dataSource); - - //커넥션에서 커넥션 풀이 생성되는 걸 보기위해 - Thread.sleep(1000); - - } - - - private void useDataSource(DataSource dataSource) throws SQLException { - Connection conn1 = DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD); - Connection conn2 = DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD); - log.info("connection={}, class={}", conn1, conn1.getClass()); - log.info("connection={}, class={}", conn2, conn2.getClass()); - } -} diff --git a/src/test/java/sopt/org/umbbaServer/TestConfig.java b/src/test/java/sopt/org/umbbaServer/TestConfig.java deleted file mode 100644 index c59d67e9..00000000 --- a/src/test/java/sopt/org/umbbaServer/TestConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package sopt.org.umbbaServer; - -import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.jdbc.datasource.DriverManagerDataSource; - -import javax.sql.DataSource; - -@TestConfiguration -public class TestConfig { - - private final String DB_URL = "jdbc:mysql://umbba-db.csqsqogfqnvj.ap-northeast-2.rds.amazonaws.com:3306/umbba_db?useSSL=true&useUnicode=true&serverTimezone=Asia/Seoul"; - private final String DB_USERNAME = "umbba_server"; - private final String DB_PASSWORD = "umbbaServer!"; - - @Bean - public DataSource dataSource() { - return new DriverManagerDataSource(DB_URL, DB_USERNAME, DB_PASSWORD); - } -} diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java index f9812b96..434dc8f5 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/service/qna/QnAService.java @@ -324,7 +324,7 @@ private GetInvitationResponseDto invitation(Long userId) { () -> new CustomException(ErrorType.USER_HAVE_NO_PARENTCHILD) ); - return GetInvitationResponseDto.of(parentchild.getInviteCode(), user.getUsername(), "http://umbba.site/"); // TODO url 설정 필요 (Firebase) + return GetInvitationResponseDto.of(parentchild.getInviteCode(), user.getUsername(), "http://umbba.site/"); // TODO Firebase 동적링크 연결 예정 } private GetInvitationResponseDto withdrawUser() { From fc828fd7006add93f7be6633ed93ac7e2b56fce9 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sun, 13 Aug 2023 00:03:44 +0900 Subject: [PATCH 25/27] =?UTF-8?q?[MERGE]=20=EB=B3=91=ED=95=A9=20=EC=B6=A9?= =?UTF-8?q?=EB=8F=8C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 19 ------------------- .../advice/ControllerExceptionAdvice.java | 12 ------------ umbba-api/src/main/resources/application.yaml | 11 ----------- .../notification/service/fcm/FCMService.java | 5 ----- 4 files changed, 47 deletions(-) diff --git a/build.gradle b/build.gradle index 7a9e0862..0252238c 100644 --- a/build.gradle +++ b/build.gradle @@ -12,28 +12,9 @@ buildscript { } } -<<<<<<< HEAD subprojects { group = "sopt.org.umbba" version = '0.0.1-SNAPSHOT' -======= -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-validation' - testImplementation 'org.projectlombok:lombok:1.18.22' - compileOnly 'org.projectlombok:lombok' - annotationProcessor 'org.projectlombok:lombok' - testAnnotationProcessor 'org.projectlombok:lombok' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - - // Health Check - implementation 'org.springframework.boot:spring-boot-starter-actuator' - - // JPA & Database - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'mysql:mysql-connector-java:8.0.32' ->>>>>>> develop - apply plugin: "java-library" apply plugin: "org.springframework.boot" apply plugin: "io.spring.dependency-management" diff --git a/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java b/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java index 9e137cc2..3d2e05ee 100644 --- a/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java +++ b/umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java @@ -20,16 +20,9 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; import org.springframework.web.util.NestedServletException; -<<<<<<< HEAD:umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java import sopt.org.umbba.common.exception.ErrorType; import sopt.org.umbba.common.exception.dto.ApiResponse; import sopt.org.umbba.common.exception.model.CustomException; -======= -import sopt.org.umbbaServer.global.common.dto.ApiResponse; -import sopt.org.umbbaServer.global.exception.CustomException; -import sopt.org.umbbaServer.global.exception.ErrorType; -import sopt.org.umbbaServer.global.util.slack.SlackApi; ->>>>>>> develop:src/main/java/sopt/org/umbbaServer/global/common/advice/ControllerExceptionAdvice.java import javax.servlet.http.HttpServletRequest; import javax.validation.UnexpectedTypeException; @@ -184,11 +177,6 @@ public ApiResponse handlerJpaSystemException(final JpaSystemException public ApiResponse handlerNullPointerException(final NullPointerException e) { return ApiResponse.error(ErrorType.NULL_POINTER_ERROR, e); } -<<<<<<< HEAD:umbba-api/src/main/java/sopt/org/umbba/api/controller/advice/ControllerExceptionAdvice.java -======= - ->>>>>>> develop:src/main/java/sopt/org/umbbaServer/global/common/advice/ControllerExceptionAdvice.java - /** * CUSTOM_ERROR diff --git a/umbba-api/src/main/resources/application.yaml b/umbba-api/src/main/resources/application.yaml index 960da133..6b561220 100644 --- a/umbba-api/src/main/resources/application.yaml +++ b/umbba-api/src/main/resources/application.yaml @@ -24,20 +24,13 @@ spring: url: ${db-url} username: ${db-user} password: ${db-pwd} -<<<<<<< HEAD:umbba-api/src/main/resources/application.yaml -======= - ->>>>>>> develop:src/main/resources/application.yaml hikari: pool-name: Hikari 커넥션 풀 # Pool connection-timeout: 30000 # 30초(default: 30초) maximum-pool-size: 10 # default: 10개 max-lifetime: 600000 # 10분(default: 30분) leak-detection-threshold: 2000 # default: 0(이용X) -<<<<<<< HEAD:umbba-api/src/main/resources/application.yaml -======= ->>>>>>> develop:src/main/resources/application.yaml jpa: show-sql: false hibernate: @@ -83,10 +76,6 @@ logging: descriptor: sql: debug com.zaxxer.hikari.pool.HikariPool: debug -<<<<<<< HEAD:umbba-api/src/main/resources/application.yaml - -======= ->>>>>>> develop:src/main/resources/application.yaml server: port: 9091 \ No newline at end of file diff --git a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java index 91064b93..7971f0ae 100644 --- a/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java +++ b/umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java @@ -230,13 +230,8 @@ public void schedulePushAlarm(String cronExpression, Long parentchildId) { log.info("스케줄링 작업 예약 내 addCount 후 count: {}", pc.getCount()); QnA todayQnA = parentchild.getQnaList().get(parentchild.getCount() - 1); -<<<<<<< HEAD:umbba-notification/src/main/java/sopt/org/umbba/notification/service/fcm/FCMService.java - em.close(); -======= // em.close(); ->>>>>>> develop:src/main/java/sopt/org/umbbaServer/global/util/fcm/FCMService.java - log.info("\n Current QnA: {} \n Today QnA: {}", currentQnA.getId(), todayQnA.getId()); if (todayQnA == null) { log.error("{}번째 Parentchild의 QnaList가 존재하지 않음!", parentchild.getId()); From 4c148702e3fedd3960b8c021ebde7f7a27001f9f Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sun, 13 Aug 2023 00:08:54 +0900 Subject: [PATCH 26/27] =?UTF-8?q?[CHORE]=20yml=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95=20#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/api-CD.yml | 2 +- .github/workflows/api-CI.yml | 2 +- .github/workflows/notification-CD.yml | 2 +- .github/workflows/notification-CI.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/api-CD.yml b/.github/workflows/api-CD.yml index c1c03d14..786f635d 100644 --- a/.github/workflows/api-CD.yml +++ b/.github/workflows/api-CD.yml @@ -52,7 +52,7 @@ jobs: - name: make application.yml 파일 생성 run: | # application.yml 파일 생성 - cd ./src/main/resources + cd ./umbba-notification/src/main/resources rm application.yaml touch ./application.yml diff --git a/.github/workflows/api-CI.yml b/.github/workflows/api-CI.yml index 777af610..91987bfd 100644 --- a/.github/workflows/api-CI.yml +++ b/.github/workflows/api-CI.yml @@ -54,7 +54,7 @@ jobs: - name: make application.yml 파일 생성 run: | ## create application.yml - cd ./src/main/resources + cd ./umbba-api/src/main/resources rm application.yaml # application.yml 파일 생성 diff --git a/.github/workflows/notification-CD.yml b/.github/workflows/notification-CD.yml index ba1a3c1d..dc631626 100644 --- a/.github/workflows/notification-CD.yml +++ b/.github/workflows/notification-CD.yml @@ -52,7 +52,7 @@ jobs: - name: make application.yml 파일 생성 run: | # application.yml 파일 생성 - cd ./src/main/resources + cd ./umbba-notification/src/main/resources rm application.yaml touch ./application.yml diff --git a/.github/workflows/notification-CI.yml b/.github/workflows/notification-CI.yml index 08a931aa..efacf47e 100644 --- a/.github/workflows/notification-CI.yml +++ b/.github/workflows/notification-CI.yml @@ -54,7 +54,7 @@ jobs: - name: make application.yml 파일 생성 run: | ## create application.yml - cd ./src/main/resources + cd ./umbba-api/src/main/resources rm application.yaml # application.yml 파일 생성 From 549320d0832ce92512510496dac612953b53c388 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sun, 13 Aug 2023 00:15:08 +0900 Subject: [PATCH 27/27] =?UTF-8?q?[CHORE]=20CI=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=8B=A4=ED=8C=A8=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?#82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/api-CD.yml | 7 ------- .github/workflows/api-CI.yml | 8 -------- .github/workflows/notification-CD.yml | 7 ------- .github/workflows/notification-CI.yml | 8 -------- 4 files changed, 30 deletions(-) diff --git a/.github/workflows/api-CD.yml b/.github/workflows/api-CD.yml index 786f635d..e845e4cb 100644 --- a/.github/workflows/api-CD.yml +++ b/.github/workflows/api-CD.yml @@ -10,13 +10,6 @@ on: - umbba-domain/** - umbba-common/** - umbba-external/** - pull_request: - branches: [ "develop" ] - paths: - - umbba-api/** - - umbba-domain/** - - umbba-common/** - - umbba-external/** env: S3_BUCKET_NAME: umbba-storage diff --git a/.github/workflows/api-CI.yml b/.github/workflows/api-CI.yml index 91987bfd..d8bd96ec 100644 --- a/.github/workflows/api-CI.yml +++ b/.github/workflows/api-CI.yml @@ -65,14 +65,6 @@ jobs: # application.yml 파일 확인 cat ./application.yml - - #################################### - - # FCM secret key 폴더 생성 - mkdir ./firebase - cd ./firebase - - aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . shell: bash diff --git a/.github/workflows/notification-CD.yml b/.github/workflows/notification-CD.yml index dc631626..564ef527 100644 --- a/.github/workflows/notification-CD.yml +++ b/.github/workflows/notification-CD.yml @@ -10,13 +10,6 @@ on: - umbba-domain/** - umbba-common/** - umbba-external/** - pull_request: - branches: [ "develop" ] - paths: - - umbba-notification/** - - umbba-domain/** - - umbba-common/** - - umbba-external/** env: S3_BUCKET_NAME: umbba-storage diff --git a/.github/workflows/notification-CI.yml b/.github/workflows/notification-CI.yml index efacf47e..9db9d55d 100644 --- a/.github/workflows/notification-CI.yml +++ b/.github/workflows/notification-CI.yml @@ -65,14 +65,6 @@ jobs: # application.yml 파일 확인 cat ./application.yml - - #################################### - - # FCM secret key 폴더 생성 - mkdir ./firebase - cd ./firebase - - aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . shell: bash