diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 2e5da52b..82cf501e 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -3,7 +3,7 @@ name: NumberOne-Backend-JIB-BUILD-DEPLOY # event trigger on: push: - branches: [ "main", "dev", "dev-check" ] + branches: [ "dev", "dev-check", "feat/multi-module" ] permissions: write-all @@ -33,6 +33,39 @@ jobs: - name: 🐧 Grant execute permission for gradlew run: chmod +x gradlew + + - name: get Current Time + run: echo "CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S' -d '+9 hours')" >> $GITHUB_ENV + + - name: πŸ”” Send Slack Message when deploy started + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + "attachments": [ + { + "title": "λŒ€ν”Όλ‘œ λ°±μ—”λ“œ 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€. πŸ‘»", + "pretext": "Daepiro backend is deploying...", + "fields": [ + { + "title": "Author πŸ’»", + "value": "${{ github.actor }}", + "short": true + }, + { + "title": "Deploy time (KST) πŸ•š", + "value": "${{ env.CURRENT_TIME }}", + "short": true + } + ] + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + if: always() + - name: πŸ”‘ Login to Docker Hub uses: docker/login-action@v2.1.0 with: @@ -41,8 +74,8 @@ jobs: - name: 🐧 create application.yml run: | - mkdir -p ./src/main/resources - cd ./src/main/resources + mkdir -p ./daepiro-app/src/main/resources + cd ./daepiro-app/src/main/resources touch ./application.yml echo "${{ secrets.PROPERTIES_PROD }}" | base64 --decode > ./application.yml ls -la @@ -50,7 +83,7 @@ jobs: - name: 🐧 create service-account.json run: | - cd ./src/main/resources + cd ./daepiro-api/src/main/resources touch ./service-account.json echo "${{ secrets.FCM }}" | base64 --decode > ./service-account.json ls -la @@ -58,10 +91,13 @@ jobs: - name: Build with jib run: | - ./gradlew jib -x test \ + ./gradlew :daepiro-app:jib -x test \ -Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ -Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ -Djib.to.image="${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest" + env: + EC2_PUBLIC_IP: ${{ secrets.EC2_PUBLIC_IP }} + JMX_PORT: ${{ secrets.JMX_PORT }} - name: Get current time uses: 1466587594/get-current-time@v2 @@ -94,7 +130,7 @@ jobs: uses: 8398a7/action-slack@v3 with: status: ${{ job.status }} - fields: repo, message, commit, author, action, eventName, ref, workflow, pullRequest + fields: repo, message, commit, author, workflow env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: always() \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3d3c2024..00000000 --- a/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM amazoncorretto:17 -EXPOSE 8080 -ARG JAR_FILE=build/libs/*.jar -COPY ${JAR_FILE} app.jar -ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file diff --git a/build.gradle b/build.gradle index 0ea0b6a8..3b562a99 100644 --- a/build.gradle +++ b/build.gradle @@ -5,116 +5,78 @@ plugins { id 'com.google.cloud.tools.jib' version '3.4.0' } -group = 'com.numberone' +group = 'com.numberone.backend' version = '0.0.1-SNAPSHOT' -jib { - from { - image = "openjdk:17-alpine" - } - to { - image = "versatile0010/numberone" - credHelper = 'ecr-login' - tags = ["latest"] - } - container { - jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m"] - } -} - - +allprojects { + apply plugin: 'java' + sourceCompatibility = JavaVersion.VERSION_17 -java { - sourceCompatibility = '17' -} - -configurations { - compileOnly { - extendsFrom annotationProcessor + repositories { + mavenCentral() + maven{url 'https://jitpack.io'} } } -repositories { - mavenCentral() +ext { + set('springCloudVersion', "2021.0.1") + queryDslVersion = "4.3.0" } -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-validation' - - // swagger - implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' - - // jpa - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - - // queryDSL - implementation "com.querydsl:querydsl-jpa:5.0.0:jakarta" - implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.8' - - annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" - annotationProcessor "jakarta.annotation:jakarta.annotation-api" - annotationProcessor "jakarta.persistence:jakarta.persistence-api" - annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa" - annotationProcessor "jakarta.annotation:jakarta.annotation-api" - annotationProcessor "jakarta.persistence:jakarta.persistence-api" - annotationProcessor 'org.projectlombok:lombok' +subprojects { + apply plugin: 'java' + apply plugin: 'io.spring.dependency-management' + apply plugin: 'java-library' + apply plugin: 'org.springframework.boot' + apply plugin: 'jacoco' - compileOnly 'org.projectlombok:lombok' + configurations { + developmentOnly + runtimeClasspath { + extendsFrom developmentOnly + } - runtimeOnly 'com.h2database:h2' - runtimeOnly 'com.mysql:mysql-connector-j' + compileOnly { + extendsFrom annotationProcessor + } + all { + exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' + } + } - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'org.springframework.security:spring-security-test' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-redis' - - implementation 'io.jsonwebtoken:jjwt:0.9.1' - implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' - implementation 'com.sun.xml.bind:jaxb-core:4.0.1' - implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - - // cloud - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + repositories { + mavenCentral() + } - // aop - implementation 'org.springframework.boot:spring-boot-starter-aop' + dependencyManagement { + imports { + mavenBom("org.springframework.boot:spring-boot-dependencies:3.1.4") + mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" + } + } - //crawling - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'org.jsoup:jsoup:1.14.2' - implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' + dependencies { + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' + annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' - //geocoding - implementation 'com.google.code.geocoder-java:geocoder-java:0.16' - // fcm - implementation 'com.google.firebase:firebase-admin:9.1.1' -} + implementation 'org.springframework.boot:spring-boot-starter-undertow' -tasks.named('test') { - useJUnitPlatform() -} + implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.10.3' + implementation 'com.google.code.gson:gson:2.10.1' -// Querydsl μ„€μ •λΆ€ -def generated = 'src/main/generated' + testImplementation('org.springframework.boot:spring-boot-starter-test') { + exclude module: 'junit' + } + testImplementation(platform('org.junit:junit-bom:5.9.3')) + testImplementation('org.junit.jupiter:junit-jupiter') + } -// querydsl QClass 파일 생성 μœ„μΉ˜λ₯Ό 지정 -tasks.withType(JavaCompile) { - options.getGeneratedSourceOutputDirectory().set(file(generated)) -} -// java source set 에 querydsl QClass μœ„μΉ˜ μΆ”κ°€ -sourceSets { - main.java.srcDirs += [ generated ] -} + tasks.named('test') { + useJUnitPlatform() + } -// gradle clean μ‹œμ— QClass 디렉토리 μ‚­μ œ -clean { - delete file(generated) } \ No newline at end of file diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle new file mode 100644 index 00000000..c6dd7b51 --- /dev/null +++ b/daepiro-api/build.gradle @@ -0,0 +1,33 @@ +dependencies { + implementation project(':daepiro-core') + implementation project(':daepiro-common') + implementation project(':daepiro-redis') + + // spring + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + // jpa + api 'org.springframework.boot:spring-boot-starter-data-jpa' + + // lombok + annotationProcessor 'org.projectlombok:lombok' + compileOnly 'org.projectlombok:lombok' + + // test + testImplementation 'org.springframework.boot:spring-boot-starter-test' + + // aop + implementation 'org.springframework.boot:spring-boot-starter-aop' + + // fcm + implementation 'com.google.firebase:firebase-admin:9.1.1' +} + +tasks.named('test') { + useJUnitPlatform() +} \ No newline at end of file diff --git a/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java similarity index 72% rename from src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java index d542a5ba..70daf5c5 100644 --- a/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java @@ -1,14 +1,11 @@ package com.numberone.backend.domain.admin.controller; -import com.numberone.backend.domain.admin.dto.request.CreateDisasterEventDto; +import com.numberone.backend.domain.admin.dto.SaveAdminDisasterRequest; import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; import com.numberone.backend.domain.admin.service.AdminService; -import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; -import com.numberone.backend.domain.disaster.event.DisasterEvent; import com.numberone.backend.domain.disaster.service.DisasterService; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; -import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -25,16 +22,16 @@ public class AdminController { @Operation(summary = "μ„œλ²„μ— 지역별 λŒ€ν”Όμ†Œ 정보 Json 파일둜 μ—…λ‘œλ“œν•˜κΈ°", description = """ - - πŸ”₯ (주의) Shelter Database 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯으둜, 10 λΆ„ 이상 μ†Œμš”λ©λ‹ˆλ‹€. - - μš”μ²­ μ‹œ, ν˜„μž¬ μ €μž₯된 λŒ€ν”Όμ†Œ db λ₯Ό 기반으둜 - - 지역 별 λŒ€ν”Όμ†Œ 정보λ₯Ό Json ν˜•νƒœλ‘œ μ •λ¦¬ν•˜μ—¬ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•©λ‹ˆλ‹€. - - λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. - - """) + + πŸ”₯ (주의) Shelter Database 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯으둜, 10 λΆ„ 이상 μ†Œμš”λ©λ‹ˆλ‹€. + + μš”μ²­ μ‹œ, ν˜„μž¬ μ €μž₯된 λŒ€ν”Όμ†Œ db λ₯Ό 기반으둜 + + 지역 별 λŒ€ν”Όμ†Œ 정보λ₯Ό Json ν˜•νƒœλ‘œ μ •λ¦¬ν•˜μ—¬ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•©λ‹ˆλ‹€. + + λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. + + """) @PostMapping("/shelter-init") public ResponseEntity uploadAllShelterInfo() { return ResponseEntity.created(URI.create("/api/admin/shelter-init")) @@ -43,12 +40,12 @@ public ResponseEntity uploadAllShelterInfo() { @Operation(summary = "μ„œλ²„μ— λŒ€ν”Όμ†Œ μ£Όμ†Œ 정보 Json 파일둜 μ—…λ‘œλ“œν•˜κΈ°", description = """ - - πŸ”₯ (주의) Shelter Database 정보λ₯Ό 기반으둜 μ£Όμ†Œ 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯μž…λ‹ˆλ‹€. - - λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. - - """) + + πŸ”₯ (주의) Shelter Database 정보λ₯Ό 기반으둜 μ£Όμ†Œ 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯μž…λ‹ˆλ‹€. + + λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. + + """) @PostMapping("/address-info") public ResponseEntity uploadAllAddressInfo() { return ResponseEntity.created(URI.create("/api/admin/address-info")) @@ -63,8 +60,8 @@ public ResponseEntity> getAllAddressInfo() { @Operation(summary = "(ν…ŒμŠ€νŠΈμš©) μž¬λ‚œ λ°œμƒμ‹œν‚€κΈ°", description = """ μ§€μ›λ˜λŠ” μž¬λ‚œ μœ ν˜•: - - + + DROUGHT("κ°€λ­„"), STRONG_WIND("강풍"), DRYNESS("건쑰"), @@ -105,7 +102,7 @@ public ResponseEntity> getAllAddressInfo() { OTHERS("기타"), """) @PostMapping("/disaster") - public ResponseEntity createDisaster(@RequestBody SaveDisasterRequest request){ + public ResponseEntity createDisaster(@RequestBody SaveAdminDisasterRequest request) { disasterService.save(request); return ResponseEntity.ok(request); } diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/dto/SaveAdminDisasterRequest.java similarity index 74% rename from src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/admin/dto/SaveAdminDisasterRequest.java index 73df95d0..bf48420d 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/dto/SaveAdminDisasterRequest.java @@ -1,6 +1,6 @@ -package com.numberone.backend.domain.disaster.dto.request; +package com.numberone.backend.domain.admin.dto; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -8,7 +8,7 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor @Builder -public class SaveDisasterRequest { +public class SaveAdminDisasterRequest { @Schema(defaultValue = "HEAVY_RAIN") private DisasterType disasterType; @Schema(defaultValue = "μ„œμšΈνŠΉλ³„μ‹œ 성동ꡬ μ„±μˆ˜λ™") @@ -22,8 +22,8 @@ public class SaveDisasterRequest { @Schema(defaultValue = "2023/11/25 15:40:00") private String createdAt; - public static SaveDisasterRequest of(DisasterType disasterType, String location, String msg, Long disasterNum, String createdAt) { - return SaveDisasterRequest.builder() + public static SaveAdminDisasterRequest of(DisasterType disasterType, String location, String msg, Long disasterNum, String createdAt) { + return SaveAdminDisasterRequest.builder() .disasterType(disasterType) .location(location) .msg(msg) diff --git a/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/admin/service/AdminService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java index 5424cb8c..db05c6a8 100644 --- a/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java @@ -2,9 +2,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; -import com.numberone.backend.domain.shelter.dto.response.GetAllSheltersResponse; +import com.numberone.backend.domain.shelter.dto.GetAllSheltersResponse; import com.numberone.backend.domain.shelter.repository.ShelterRepository; -import com.numberone.backend.support.s3.S3Provider; +import com.numberone.backend.provider.s3.S3Provider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java index d4bea002..313f6a0f 100644 --- a/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java @@ -1,12 +1,12 @@ package com.numberone.backend.domain.article.controller; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameterDto; import com.numberone.backend.domain.article.dto.request.ModifyArticleRequest; import com.numberone.backend.domain.article.dto.request.UploadArticleRequest; import com.numberone.backend.domain.article.dto.response.*; import com.numberone.backend.domain.article.service.ArticleService; import com.numberone.backend.domain.comment.dto.request.CreateCommentRequest; import com.numberone.backend.domain.comment.dto.response.CreateCommentResponse; -import com.numberone.backend.support.redis.like.service.RedisLockLikeFacade; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; @@ -25,7 +25,6 @@ public class ArticleController { private final ArticleService articleService; - private final RedisLockLikeFacade redisLockLikeFacade; @Operation(summary = "κ²Œμ‹œκΈ€ μž‘μ„± API", description = """ @@ -87,37 +86,37 @@ public ResponseEntity getArticleDetails(@PathVariable( @GetMapping public ResponseEntity> getArticlePages( Pageable pageable, - @ModelAttribute ArticleSearchParameter param) { - return ResponseEntity.ok(articleService.getArticleListPaging(param, pageable)); + @ModelAttribute ArticleSearchParameterDto paramDto) { + return ResponseEntity.ok(articleService.getArticleListPaging(paramDto.toParameter(), pageable)); } @Operation(summary = "κ²Œμ‹œκΈ€μ— λŒ“κΈ€ μž‘μ„±ν•˜κΈ°", description = """ κ²Œμ‹œκΈ€μ— λŒ“κΈ€μ„ μž‘μ„±ν•˜λŠ” API μž…λ‹ˆλ‹€. - + κ²Œμ‹œκΈ€ μ•„μ΄λ””λŠ” Path variable 으둜 λ„˜κ²¨μ£Όμ„Έμš” (article-id) - + """) @PostMapping("comments/{article-id}") public ResponseEntity createComment( @PathVariable("article-id") Long articleId, @RequestBody @Valid CreateCommentRequest request) { return ResponseEntity.created( - URI.create(String.format("/api/articles/comment/%s", articleId))) + URI.create(String.format("/api/articles/comment/%s", articleId))) .body(articleService.createComment(articleId, request)); } @Operation(summary = "κ²Œμ‹œκΈ€ μˆ˜μ •ν•˜κΈ°", description = """ κ²Œμ‹œκΈ€ λ‚΄μš©μ„ μˆ˜μ •ν•˜λŠ” API μž…λ‹ˆλ‹€. - + λ°˜λ“œμ‹œ access token 을 헀더에 ν¬ν•¨ν•΄μ„œ μš”μ²­ν•΄μ£Όμ„Έμš”. - + article-id λŠ” path variable 으둜 λ„˜κ²¨μ£Όμ„Έμš”. """) @PutMapping("{article-id}/modify") public ResponseEntity modifyArticle( @PathVariable("article-id") Long articleId, - @RequestBody @Valid ModifyArticleRequest request ){ + @RequestBody @Valid ModifyArticleRequest request) { return ResponseEntity.ok(articleService.modifyArticle(articleId, request)); } diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameterDto.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameterDto.java new file mode 100644 index 00000000..fcffe3f3 --- /dev/null +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameterDto.java @@ -0,0 +1,27 @@ +package com.numberone.backend.domain.article.dto.parameter; + +import com.numberone.backend.domain.article.entity.ArticleTag; +import lombok.*; + +@ToString +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class ArticleSearchParameterDto { + private ArticleTag tag; + private Long lastArticleId; + private Double longitude; + private Double latitude; + private String regionLv2; // ꡬ + + public ArticleSearchParameter toParameter () { + return ArticleSearchParameter.builder() + .tag(tag) + .lastArticleId(lastArticleId) + .longitude(longitude) + .latitude(latitude) + .regionLv2(regionLv2) + .build(); + } +} diff --git a/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java index 8b8ca343..b8e41df7 100644 --- a/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.numberone.backend.domain.article.entity.Article; -import com.numberone.backend.domain.article.entity.ArticleStatus; import com.numberone.backend.domain.article.entity.ArticleTag; import com.numberone.backend.domain.member.entity.Member; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/article/service/ArticleService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java index 41e46790..b60d83ee 100644 --- a/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java @@ -1,5 +1,6 @@ package com.numberone.backend.domain.article.service; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameter; import com.numberone.backend.domain.article.dto.request.ModifyArticleRequest; import com.numberone.backend.domain.article.dto.request.UploadArticleRequest; import com.numberone.backend.domain.article.dto.response.*; @@ -23,13 +24,13 @@ import com.numberone.backend.domain.notification.repository.NotificationRepository; import com.numberone.backend.domain.notificationregion.entity.NotificationRegion; import com.numberone.backend.domain.notificationregion.repository.NotificationRegionRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.conflict.UnauthorizedLocationException; import com.numberone.backend.exception.notfound.NotFoundArticleException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; -import com.numberone.backend.support.s3.S3Provider; -import com.numberone.backend.util.LocationProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.location.LocationProvider; +import com.numberone.backend.provider.s3.S3Provider; +import com.numberone.backend.provider.security.SecurityContextProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; @@ -225,7 +226,7 @@ public CreateCommentResponse createComment(Long articleId, CreateCommentRequest λ‚˜μ˜ κ²Œμ‹œκΈ€μ— %sλ‹˜μ΄ λŒ“κΈ€μ„ λ‹¬μ•˜μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(articleOwner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(articleOwner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(articleOwner, NotificationTag.COMMUNITY, title, body, true) ); diff --git a/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java index be571887..9c2efae9 100644 --- a/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java @@ -3,13 +3,12 @@ import com.numberone.backend.domain.comment.dto.request.CreateChildCommentRequest; import com.numberone.backend.domain.comment.dto.response.CreateChildCommentResponse; import com.numberone.backend.domain.comment.dto.response.DeleteCommentResponse; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; import com.numberone.backend.domain.comment.service.CommentService; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.hibernate.sql.Delete; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java similarity index 85% rename from src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java index 057e6a72..80909822 100644 --- a/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.comment.dto.request; -import com.numberone.backend.config.basetime.BaseTimeEntity; import jakarta.validation.constraints.NotNull; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java diff --git a/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java similarity index 95% rename from src/main/java/com/numberone/backend/domain/comment/service/CommentService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java index 1c3617c9..2e7ea551 100644 --- a/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java @@ -7,7 +7,7 @@ import com.numberone.backend.domain.comment.dto.request.CreateChildCommentRequest; import com.numberone.backend.domain.comment.dto.response.CreateChildCommentResponse; import com.numberone.backend.domain.comment.dto.response.DeleteCommentResponse; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; import com.numberone.backend.domain.comment.entity.CommentEntity; import com.numberone.backend.domain.comment.repository.CommentRepository; import com.numberone.backend.domain.like.entity.CommentLike; @@ -17,11 +17,11 @@ import com.numberone.backend.domain.notification.entity.NotificationEntity; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; +import com.numberone.backend.provider.security.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundArticleException; import com.numberone.backend.exception.notfound.NotFoundCommentException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -69,7 +69,7 @@ public CreateChildCommentResponse createChildComment( String title = String.format(""" λ‚˜μ˜ λŒ“κΈ€μ— %sλ‹˜μ΄ λŒ“κΈ€μ„ λ‹¬μ•˜μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(owner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(owner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(owner, NotificationTag.COMMUNITY, title, body, true) ); diff --git a/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java index 3ae92f17..87e9d93b 100644 --- a/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java @@ -2,13 +2,11 @@ import com.numberone.backend.domain.conversation.dto.request.CreateChildConversationRequest; import com.numberone.backend.domain.conversation.dto.request.CreateConversationRequest; -import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import com.numberone.backend.domain.conversation.service.ConversationService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java index 42b1d661..5e709181 100644 --- a/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java @@ -7,7 +7,6 @@ import java.time.Duration; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; import java.util.List; import java.util.Locale; diff --git a/src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java similarity index 71% rename from src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java index e9269d00..6bea9029 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java @@ -1,12 +1,8 @@ package com.numberone.backend.domain.disaster.dto.request; -import com.numberone.backend.domain.disaster.dto.response.LatestDisasterResponse; -import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; -import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java index 4f5c2f0e..af526c6b 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.disaster.dto.response; import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java similarity index 85% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java index c66702cd..83a92a7a 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.disaster.dto.response; -import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import lombok.*; import java.util.ArrayList; diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java index bf792afd..06db71f6 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java @@ -2,12 +2,10 @@ import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.time.Duration; -import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Locale; diff --git a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java index 68753ee1..230aa21e 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.disaster.service; import com.numberone.backend.domain.disaster.event.DisasterEvent; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.friendship.entity.Friendship; import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.repository.MemberRepository; @@ -12,11 +12,10 @@ import com.numberone.backend.domain.notificationdisaster.repository.NotificationDisasterRepository; import com.numberone.backend.domain.notificationregion.repository.NotificationRegionRepository; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.event.TransactionalEventListener; @@ -79,7 +78,7 @@ public void sendFcmsPresentLocationAndOnboardingDisasterType(DisasterEvent disas // fcm 메세지 일괄 전솑 log.info("ν˜„μž¬ μž¬λ‚œ μœ„μΉ˜μ— μžˆλŠ”, {} μž¬λ‚œ μœ ν˜•μ„ ν—ˆμš©ν•œ νšŒμ›λ“€μ—κ²Œ μ•Œλ¦Όμ„ μ „μ†‘ν•©λ‹ˆλ‹€.", type); - fcmMessageProvider.sendFcmToMembers(fcmTokensByPresentLocationAndOnboardingDisasterType, title, message, NotificationTag.DISASTER); + fcmMessageProvider.sendFcmToMembers(fcmTokensByPresentLocationAndOnboardingDisasterType, title, message); // μ˜¨λ³΄λ”©λ•Œ μ„ νƒν•œ 지역에 λŒ€ν•œ μ•Œλ¦Όμ„ λ°›κ³ μž ν•˜λŠ” νšŒμ› 리슀트λ₯Ό ν•„ν„°λ§ν•©λ‹ˆλ‹€. // μ΄λ•Œ 쀑볡 μ•Œλ¦Ό λ°œμ†‘μ„ λ°©μ§€ν•˜κΈ° μœ„ν•œ 필터링 μž‘μ—…μ„ λ¨Όμ € μˆ˜ν–‰ν•©λ‹ˆλ‹€. @@ -111,7 +110,7 @@ public void sendFcmsPresentLocationAndOnboardingDisasterType(DisasterEvent disas } return (isRegionMatched && isDisasterTypeMatched) ? Stream.of(member.getFcmToken()) : null; }).filter(Objects::nonNull).toList(); - fcmMessageProvider.sendFcmToMembers(targetFcmsByOnboardingRegionsAndDisasterTypes, title, message, NotificationTag.DISASTER); + fcmMessageProvider.sendFcmToMembers(targetFcmsByOnboardingRegionsAndDisasterTypes, title, message); } @Transactional(jakarta.transaction.Transactional.TxType.REQUIRES_NEW) @@ -142,7 +141,7 @@ public void sendFcmToFriends(DisasterEvent disasterEvent) { %sλ‹˜μ΄ μœ„ν—˜ 지역에 μžˆμ–΄μš”. μ§€κΈˆ λ°”λ‘œ %sλ‹˜μ—κ²Œ μ•ˆλΆ€λ₯Ό λ¬Όμ–΄λ³΄μ„Έμš”! """, memberName, memberName); - fcmMessageProvider.sendFcmToMembers(friendFcmTokens, title, body, NotificationTag.FAMILY); + fcmMessageProvider.sendFcmToMembers(friendFcmTokens, title, body); friendList.forEach(friend -> notificationRepository.save( diff --git a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java index 8852475a..b489a151 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java @@ -1,11 +1,11 @@ package com.numberone.backend.domain.disaster.service; +import com.numberone.backend.domain.admin.dto.SaveAdminDisasterRequest; import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import com.numberone.backend.domain.conversation.entity.Conversation; import com.numberone.backend.domain.conversation.repository.ConversationRepository; import com.numberone.backend.domain.conversation.service.ConversationService; import com.numberone.backend.domain.disaster.dto.request.LatestDisasterRequest; -import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; import com.numberone.backend.domain.disaster.dto.response.LatestDisasterResponse; import com.numberone.backend.domain.disaster.dto.response.SituationDetailResponse; import com.numberone.backend.domain.disaster.dto.response.SituationHomeResponse; @@ -13,14 +13,14 @@ import com.numberone.backend.domain.disaster.entity.Disaster; import com.numberone.backend.domain.disaster.event.DisasterEvent; import com.numberone.backend.domain.disaster.repository.DisasterRepository; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.service.MemberService; import com.numberone.backend.domain.notificationdisaster.entity.NotificationDisaster; import com.numberone.backend.domain.notificationregion.entity.NotificationRegion; import com.numberone.backend.exception.badrequest.BadRequestConversationSortException; import com.numberone.backend.exception.notfound.NotFoundDisasterException; -import com.numberone.backend.util.LocationProvider; +import com.numberone.backend.provider.location.LocationProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.ApplicationEventPublisher; @@ -28,11 +28,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.awt.print.Pageable; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; -import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -86,7 +84,7 @@ public LatestDisasterResponse getLatestDisaster(String email, LatestDisasterRequ } @Transactional - public void save(SaveDisasterRequest saveDisasterRequest) { + public void save(SaveAdminDisasterRequest saveDisasterRequest) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); LocalDateTime dateTime = LocalDateTime.parse(saveDisasterRequest.getCreatedAt(), formatter); Disaster savedDisaster = diff --git a/src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java index 14ccbf27..482df89d 100644 --- a/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java @@ -3,8 +3,6 @@ import com.numberone.backend.domain.member.entity.Member; import lombok.*; -import java.util.List; - @ToString @Builder @Getter diff --git a/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java index 988d78c9..a55475c6 100644 --- a/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java @@ -10,21 +10,18 @@ import com.numberone.backend.domain.notification.entity.NotificationEntity; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; +import com.numberone.backend.provider.security.SecurityContextProvider; import com.numberone.backend.exception.badrequest.InvalidInviteTypeException; import com.numberone.backend.exception.notfound.NotFoundFriendshipException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.Stream; @Slf4j @Service @@ -99,7 +96,7 @@ public SendFcmFriendResponse sendFcmToFriend(Long friendId) { String body = String.format(""" %sλ‹˜μ΄ μ•ˆλΆ€λ₯Ό κΆκΈˆν•΄ν•˜κ³  μžˆμ–΄μš”. κ±±μ •ν•˜κ³  μžˆμ„ %sλ‹˜μ„ μœ„ν•΄ 빨리 μ—°λ½ν•΄μ£Όμ„Έμš”!""", memberName, memberName); - fcmMessageProvider.sendFcm(friend, title, body, NotificationTag.FAMILY); + fcmMessageProvider.sendFcm(friend.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(friend, NotificationTag.FAMILY, title, body, true) ); diff --git a/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java similarity index 88% rename from src/main/java/com/numberone/backend/domain/like/controller/LikeController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java index 7a2ba262..49eb294f 100644 --- a/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java @@ -1,8 +1,8 @@ package com.numberone.backend.domain.like.controller; -import com.numberone.backend.domain.like.dto.response.response.ArticleLikeResponse; -import com.numberone.backend.domain.like.dto.response.response.CommentLikeResponse; -import com.numberone.backend.support.redis.like.service.RedisLockLikeFacade; +import com.numberone.backend.domain.like.dto.response.ArticleLikeResponse; +import com.numberone.backend.domain.like.dto.response.CommentLikeResponse; +import com.numberone.backend.domain.like.service.RedisLockLikeFacade; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/ArticleLikeResponse.java similarity index 77% rename from src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/ArticleLikeResponse.java index 6e66a9e2..444ff437 100644 --- a/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/ArticleLikeResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.like.dto.response.response; +package com.numberone.backend.domain.like.dto.response; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/CommentLikeResponse.java similarity index 77% rename from src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/CommentLikeResponse.java index 2c41c8d2..8f2db0a4 100644 --- a/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/CommentLikeResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.like.dto.response.response; +package com.numberone.backend.domain.like.dto.response; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/like/service/LikeService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/like/service/LikeService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java index 0cd7e4df..f8a30c9a 100644 --- a/src/main/java/com/numberone/backend/domain/like/service/LikeService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java @@ -13,23 +13,20 @@ import com.numberone.backend.domain.notification.entity.NotificationEntity; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; +import com.numberone.backend.provider.security.SecurityContextProvider; import com.numberone.backend.exception.conflict.AlreadyLikedException; import com.numberone.backend.exception.conflict.AlreadyUnLikedException; import com.numberone.backend.exception.notfound.NotFoundApiException; import com.numberone.backend.exception.notfound.NotFoundCommentException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.hibernate.id.IntegralDataTypeHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; -import static com.numberone.backend.support.notification.NotificationMessage.BEST_ARTICLE_FCM_ALARM; - @Slf4j @Service @RequiredArgsConstructor @@ -68,7 +65,7 @@ public Integer increaseArticleLike(Long articleId) { String title = String.format(""" λ‚˜μ˜ κ²Œμ‹œκΈ€μ— %sλ‹˜μ΄ μ’‹μ•„μš”λ₯Ό λˆŒλ €μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(owner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(owner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(owner, NotificationTag.COMMUNITY, title, body, true) ); @@ -120,7 +117,7 @@ public Integer increaseCommentLike(Long commentId) { String title = String.format(""" λ‚˜μ˜ λŒ“κΈ€μ— %sλ‹˜μ΄ μ’‹μ•„μš”λ₯Ό λˆŒλ €μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(owner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(owner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(owner, NotificationTag.COMMUNITY, title, body, true) ); diff --git a/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java similarity index 86% rename from src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java index 13c82a57..814bdfe5 100644 --- a/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java @@ -1,9 +1,8 @@ -package com.numberone.backend.support.redis.like.service; +package com.numberone.backend.domain.like.service; -import com.numberone.backend.domain.like.dto.response.response.ArticleLikeResponse; -import com.numberone.backend.domain.like.dto.response.response.CommentLikeResponse; -import com.numberone.backend.domain.like.service.LikeService; -import com.numberone.backend.support.redis.like.repository.RedisLockRepository; +import com.numberone.backend.domain.like.dto.response.ArticleLikeResponse; +import com.numberone.backend.domain.like.dto.response.CommentLikeResponse; +import com.numberone.backend.domain.like.repository.RedisLockRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/member/controller/MemberController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java index 489cafab..415a940c 100644 --- a/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java @@ -10,10 +10,8 @@ import com.numberone.backend.domain.member.dto.response.UploadProfileImageResponse; import com.numberone.backend.domain.member.service.MemberService; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; -import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.Authentication; @@ -24,7 +22,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java similarity index 78% rename from src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java index 72498c9a..1c01252f 100644 --- a/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java @@ -1,7 +1,9 @@ package com.numberone.backend.domain.member.dto.request; import jakarta.validation.constraints.NotNull; -import lombok.*; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; @NoArgsConstructor(access = AccessLevel.PROTECTED) @Getter diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java similarity index 88% rename from src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java index 33b8abc6..48284159 100644 --- a/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java @@ -1,7 +1,6 @@ package com.numberone.backend.domain.member.dto.request; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java index 47c5c752..6a69fff5 100644 --- a/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java @@ -1,7 +1,6 @@ package com.numberone.backend.domain.member.dto.response; import com.numberone.backend.domain.member.entity.Member; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @Getter diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java diff --git a/src/main/java/com/numberone/backend/domain/member/service/MemberService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java similarity index 95% rename from src/main/java/com/numberone/backend/domain/member/service/MemberService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java index bf3ebb1c..658fd7f1 100644 --- a/src/main/java/com/numberone/backend/domain/member/service/MemberService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.member.service; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.dto.request.*; import com.numberone.backend.domain.member.dto.response.GetNotificationRegionResponse; import com.numberone.backend.domain.member.dto.response.HeartCntResponse; @@ -12,18 +12,16 @@ import com.numberone.backend.domain.notificationdisaster.repository.NotificationDisasterRepository; import com.numberone.backend.domain.notificationregion.entity.NotificationRegion; import com.numberone.backend.domain.notificationregion.repository.NotificationRegionRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.s3.S3Provider; -import com.numberone.backend.util.LocationProvider; +import com.numberone.backend.provider.location.LocationProvider; +import com.numberone.backend.provider.s3.S3Provider; +import com.numberone.backend.provider.security.SecurityContextProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import java.util.List; - @RequiredArgsConstructor @Service @Slf4j @@ -50,7 +48,7 @@ public void initMemberData(String email, OnboardingRequest onboardingRequest) { Member member = memberRepository.findByEmail(email) .orElseThrow(NotFoundMemberException::new); notificationDisasterRepository.deleteAllByMemberId(member.getId()); - member.setOnboardingData(onboardingRequest.getRealname(),onboardingRequest.getNickname(), onboardingRequest.getFcmToken()); + member.setOnboardingData(onboardingRequest.getRealname(), onboardingRequest.getNickname(), onboardingRequest.getFcmToken()); notificationRegionRepository.deleteAllByMemberId(member.getId()); for (OnboardingAddress address : onboardingRequest.getAddresses()) { notificationRegionRepository.save(NotificationRegion.of( diff --git a/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java similarity index 81% rename from src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java index c0feb674..50732a11 100644 --- a/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.notification.controller; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameterDto; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import com.numberone.backend.domain.notification.service.NotificationService; import io.swagger.v3.oas.annotations.Operation; @@ -9,9 +9,10 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import java.util.List; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; @Slf4j @RequestMapping("/api/notifications") @@ -33,8 +34,8 @@ public class NotificationController { @GetMapping public ResponseEntity> getNotificationPage( Pageable pageable, - @ModelAttribute NotificationSearchParameter param){ - return ResponseEntity.ok(notificationService.getNotificationTabPagesByMember(param, pageable)); + @ModelAttribute NotificationSearchParameterDto paramDto) { + return ResponseEntity.ok(notificationService.getNotificationTabPagesByMember(paramDto.toParameter(), pageable)); } } diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameterDto.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameterDto.java new file mode 100644 index 00000000..fa2b3699 --- /dev/null +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameterDto.java @@ -0,0 +1,21 @@ +package com.numberone.backend.domain.notification.dto.request; + +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; +import lombok.*; + +@ToString +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class NotificationSearchParameterDto { + Long lastNotificationId; + Boolean isDisaster; + + public NotificationSearchParameter toParameter(){ + return NotificationSearchParameter.builder() + .lastNotificationId(lastNotificationId) + .isDisaster(isDisaster) + .build(); + } +} diff --git a/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java similarity index 90% rename from src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java index 72fdce55..ca724f96 100644 --- a/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java @@ -2,11 +2,11 @@ import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.repository.MemberRepository; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundMemberException; +import com.numberone.backend.provider.security.SecurityContextProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java similarity index 90% rename from src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java index 3970f627..eca76e27 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java @@ -1,9 +1,7 @@ package com.numberone.backend.domain.shelter.dto.request; -import com.numberone.backend.domain.shelter.util.ShelterType; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Null; import lombok.*; @ToString diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java similarity index 95% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java index 984e1689..40353d4a 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java @@ -1,5 +1,6 @@ package com.numberone.backend.domain.shelter.dto.response; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import lombok.*; import java.util.List; diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java index f8aa6008..d0f71966 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java @@ -1,5 +1,6 @@ package com.numberone.backend.domain.shelter.dto.response; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import lombok.*; @ToString diff --git a/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java index d8b96dfc..c3c60c44 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java @@ -1,11 +1,12 @@ package com.numberone.backend.domain.shelter.service; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import com.numberone.backend.domain.shelter.dto.request.NearbyShelterRequest; import com.numberone.backend.domain.shelter.dto.response.*; import com.numberone.backend.domain.shelter.repository.ShelterRepository; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.ShelterType; import com.numberone.backend.exception.notfound.NotFoundShelterException; -import com.numberone.backend.support.s3.S3Provider; +import com.numberone.backend.provider.s3.S3Provider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java diff --git a/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java diff --git a/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java index b9d76076..1b38db60 100644 --- a/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java @@ -3,12 +3,10 @@ import com.numberone.backend.domain.sponsor.entity.Sponsor; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import org.hibernate.annotations.Comment; import java.time.LocalDate; import java.time.Period; import java.time.format.DateTimeFormatter; -import java.util.Locale; @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) diff --git a/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java index 11eeb019..a8042e43 100644 --- a/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java @@ -11,7 +11,6 @@ import com.numberone.backend.exception.notfound.NotFoundMemberException; import com.numberone.backend.exception.notfound.NotFoundSponsorException; import lombok.RequiredArgsConstructor; -import org.apache.tomcat.util.net.openssl.ciphers.Authentication; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/support/controller/SupportController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java index aeec522e..a381d747 100644 --- a/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java @@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java diff --git a/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java diff --git a/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java similarity index 88% rename from src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java index cecccfba..858e558d 100644 --- a/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.support.dto.response; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @Getter diff --git a/src/main/java/com/numberone/backend/domain/support/service/SupportService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/service/SupportService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/service/SupportService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/service/SupportService.java diff --git a/src/main/java/com/numberone/backend/support/logging/LogAspect.java b/daepiro-api/src/main/java/com/numberone/backend/support/logging/LogAspect.java similarity index 100% rename from src/main/java/com/numberone/backend/support/logging/LogAspect.java rename to daepiro-api/src/main/java/com/numberone/backend/support/logging/LogAspect.java diff --git a/src/main/resources/logback-spring.xml b/daepiro-api/src/main/resources/logback-spring.xml similarity index 100% rename from src/main/resources/logback-spring.xml rename to daepiro-api/src/main/resources/logback-spring.xml diff --git a/daepiro-app/build.gradle b/daepiro-app/build.gradle new file mode 100644 index 00000000..4288ad08 --- /dev/null +++ b/daepiro-app/build.gradle @@ -0,0 +1,51 @@ +plugins { + id 'com.google.cloud.tools.jib' version '3.4.0' +} + +dependencies { + implementation project(':daepiro-core') + implementation project(':daepiro-common') + implementation project(':daepiro-redis') + implementation project(':daepiro-api') + implementation project(':daepiro-crawler') + implementation project(':daepiro-auth') + + // spring + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-security' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + // lombok + annotationProcessor 'org.projectlombok:lombok' + compileOnly 'org.projectlombok:lombok' + +} + +tasks.named('test') { + useJUnitPlatform() +} + +def serverIP = System.getenv("EC2_PUBLIC_IP") +def jmxPort = System.getenv("JMX_PORT") + +jib { + from { + image = "openjdk:17" + } + to { + image = "versatile0010/numberone" + tags = ["latest"] + } + container { + mainClass = 'com.numberone.backend.BackendApplication' + creationTime = "USE_CURRENT_TIMESTAMP" + jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/heap-dumps/heapdump.hprof"] + ports = ['8080'] + } +} + +tasks.bootJar { + enabled = true +} \ No newline at end of file diff --git a/src/main/java/com/numberone/backend/BackendApplication.java b/daepiro-app/src/main/java/com/numberone/backend/BackendApplication.java similarity index 78% rename from src/main/java/com/numberone/backend/BackendApplication.java rename to daepiro-app/src/main/java/com/numberone/backend/BackendApplication.java index 8cfd171d..3fb21b3a 100644 --- a/src/main/java/com/numberone/backend/BackendApplication.java +++ b/daepiro-app/src/main/java/com/numberone/backend/BackendApplication.java @@ -2,8 +2,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; @SpringBootApplication +@ServletComponentScan public class BackendApplication { public static void main(String[] args) { SpringApplication.run(BackendApplication.class, args); diff --git a/src/main/java/com/numberone/backend/HelloController.java b/daepiro-app/src/main/java/com/numberone/backend/HelloController.java similarity index 100% rename from src/main/java/com/numberone/backend/HelloController.java rename to daepiro-app/src/main/java/com/numberone/backend/HelloController.java diff --git a/src/main/java/com/numberone/backend/LoginTestController.java b/daepiro-app/src/main/java/com/numberone/backend/LoginTestController.java similarity index 100% rename from src/main/java/com/numberone/backend/LoginTestController.java rename to daepiro-app/src/main/java/com/numberone/backend/LoginTestController.java diff --git a/src/main/java/com/numberone/backend/LoginTestResponse.java b/daepiro-app/src/main/java/com/numberone/backend/LoginTestResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/LoginTestResponse.java rename to daepiro-app/src/main/java/com/numberone/backend/LoginTestResponse.java diff --git a/daepiro-auth/build.gradle b/daepiro-auth/build.gradle new file mode 100644 index 00000000..ac024334 --- /dev/null +++ b/daepiro-auth/build.gradle @@ -0,0 +1,32 @@ +dependencies { + implementation project(':daepiro-core') + implementation project(':daepiro-redis') + implementation project(':daepiro-common') + implementation project(':daepiro-api') // todo: remove it + + // spring + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // lombok + compileOnly 'org.projectlombok:lombok' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + // oauth + implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + + // security + implementation 'org.springframework.boot:spring-boot-starter-security' + + implementation 'io.jsonwebtoken:jjwt-api:0.11.5' + runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5' + runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' + +} + +tasks.bootJar { + enabled = false +} diff --git a/src/main/java/com/numberone/backend/config/SecurityConfig.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/config/SecurityConfig.java similarity index 96% rename from src/main/java/com/numberone/backend/config/SecurityConfig.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/config/SecurityConfig.java index e2eef9b7..d1d69f54 100644 --- a/src/main/java/com/numberone/backend/config/SecurityConfig.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/config/SecurityConfig.java @@ -1,6 +1,6 @@ -package com.numberone.backend.config; +package com.numberone.backend.domain.config; -import com.numberone.backend.config.auth.JwtFilter; +import com.numberone.backend.domain.filter.JwtFilter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/com/numberone/backend/config/auth/JwtFilter.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/filter/JwtFilter.java similarity index 86% rename from src/main/java/com/numberone/backend/config/auth/JwtFilter.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/filter/JwtFilter.java index 4b8445af..496c011a 100644 --- a/src/main/java/com/numberone/backend/config/auth/JwtFilter.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/filter/JwtFilter.java @@ -1,9 +1,9 @@ -package com.numberone.backend.config.auth; +package com.numberone.backend.domain.filter; import com.fasterxml.jackson.databind.ObjectMapper; import com.numberone.backend.domain.member.entity.Member; -import com.numberone.backend.domain.member.service.MemberService; -import com.numberone.backend.domain.token.util.JwtUtil; +import com.numberone.backend.domain.member.repository.MemberRepository; +import com.numberone.backend.domain.service.JwtProvider; import com.numberone.backend.exception.context.ExceptionContext; import com.numberone.backend.exception.dto.ErrorResponse; import com.numberone.backend.exception.notfound.NotFoundMemberException; @@ -28,8 +28,9 @@ @RequiredArgsConstructor @Component public class JwtFilter extends OncePerRequestFilter { - private final JwtUtil jwtUtil; - private final MemberService memberService; + + private final JwtProvider jwtProvider; + private final MemberRepository memberRepository; @Override protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException { @@ -47,18 +48,19 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse return; } String token = authorizationHeader.split(" ")[1]; - if (!jwtUtil.isValid(token)) { + if (!jwtProvider.isValid(token)) { setErrorResponse(response, WRONG_ACCESS_TOKEN); return; } - if (jwtUtil.isExpired(token)) { + if (jwtProvider.isExpired(token)) { setErrorResponse(response, EXPIRED_ACCESS_TOKEN); return; } - String email = jwtUtil.getEmail(token); + String email = jwtProvider.getEmail(token); try { - Member member = memberService.findByEmail(email); + Member member = memberRepository.findByEmail(email) + .orElseThrow(NotFoundMemberException::new); UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken( member.getEmail(), null, Collections.emptyList()); authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); diff --git a/src/main/java/com/numberone/backend/properties/JwtProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/JwtProperties.java similarity index 84% rename from src/main/java/com/numberone/backend/properties/JwtProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/JwtProperties.java index 8e51b032..ed78b8ca 100644 --- a/src/main/java/com/numberone/backend/properties/JwtProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/JwtProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/src/main/java/com/numberone/backend/properties/KakaoProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/KakaoProperties.java similarity index 89% rename from src/main/java/com/numberone/backend/properties/KakaoProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/KakaoProperties.java index 38d147d6..a05d969b 100644 --- a/src/main/java/com/numberone/backend/properties/KakaoProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/KakaoProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/src/main/java/com/numberone/backend/properties/NaverProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/NaverProperties.java similarity index 89% rename from src/main/java/com/numberone/backend/properties/NaverProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/NaverProperties.java index 87f22bda..a562af92 100644 --- a/src/main/java/com/numberone/backend/properties/NaverProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/NaverProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/TokenPeriodProperties.java similarity index 86% rename from src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/TokenPeriodProperties.java index cb1473e6..5cb32d67 100644 --- a/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/TokenPeriodProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/JwtProvider.java similarity index 85% rename from src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/service/JwtProvider.java index b2c8fb5e..36cf39af 100644 --- a/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/JwtProvider.java @@ -1,20 +1,17 @@ -package com.numberone.backend.domain.token.util; +package com.numberone.backend.domain.service; -import com.numberone.backend.domain.token.service.TokenService; -import com.numberone.backend.properties.JwtProperties; +import com.numberone.backend.domain.properties.JwtProperties; import io.jsonwebtoken.*; -import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; -import java.util.Base64; import java.util.Date; @Slf4j @Component @RequiredArgsConstructor -public class JwtUtil { +public class JwtProvider { private final JwtProperties jwtProperties; public String createToken(String email, long period) { diff --git a/src/main/java/com/numberone/backend/domain/token/service/TokenService.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/TokenService.java similarity index 80% rename from src/main/java/com/numberone/backend/domain/token/service/TokenService.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/service/TokenService.java index 5b134faa..9a8c89ad 100644 --- a/src/main/java/com/numberone/backend/domain/token/service/TokenService.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/TokenService.java @@ -1,20 +1,21 @@ -package com.numberone.backend.domain.token.service; +package com.numberone.backend.domain.service; import com.numberone.backend.domain.member.repository.MemberRepository; import com.numberone.backend.domain.member.service.MemberService; +import com.numberone.backend.domain.properties.KakaoProperties; +import com.numberone.backend.domain.properties.NaverProperties; +import com.numberone.backend.domain.properties.TokenPeriodProperties; import com.numberone.backend.domain.token.dto.request.GetTokenRequest; import com.numberone.backend.domain.token.dto.request.RefreshTokenRequest; -import com.numberone.backend.domain.token.dto.response.*; +import com.numberone.backend.domain.token.dto.response.GetTokenResponse; +import com.numberone.backend.domain.token.dto.response.KakaoInfoResponse; +import com.numberone.backend.domain.token.dto.response.NaverInfoResponse; +import com.numberone.backend.domain.token.dto.response.RefreshTokenResponse; import com.numberone.backend.domain.token.entity.Token; import com.numberone.backend.domain.token.repository.TokenRepository; import com.numberone.backend.exception.badrequest.BadRequestSocialTokenException; import com.numberone.backend.exception.forbidden.WrongAccessTokenException; import com.numberone.backend.exception.notfound.NotFoundRefreshTokenException; -import com.numberone.backend.properties.KakaoProperties; -import com.numberone.backend.properties.NaverProperties; -import com.numberone.backend.domain.token.util.JwtUtil; -import com.numberone.backend.properties.TokenPeriodProperties; -import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.*; @@ -22,14 +23,12 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; -import java.util.Optional; - @Service @RequiredArgsConstructor @Transactional(readOnly = true) @Slf4j public class TokenService { - private final JwtUtil jwtUtil; + private final JwtProvider jwtProvider; private final RestTemplate restTemplate; private final KakaoProperties kakaoProperties; private final NaverProperties naverProperties; @@ -76,13 +75,13 @@ public GetTokenResponse loginNaver(GetTokenRequest tokenRequest) { @Transactional public RefreshTokenResponse refresh(RefreshTokenRequest tokenRequest) { - if (!jwtUtil.isValid(tokenRequest.getToken())) + if (!jwtProvider.isValid(tokenRequest.getToken())) throw new NotFoundRefreshTokenException(); Token token = tokenRepository.findByRefreshToken(tokenRequest.getToken()) .orElseThrow(NotFoundRefreshTokenException::new); - String email = jwtUtil.getEmail(tokenRequest.getToken()); - String newAccessToken = jwtUtil.createToken(email, tokenPeriodProperties.getAccess()); - String newRefreshToken = jwtUtil.createToken(email, tokenPeriodProperties.getRefresh()); + String email = jwtProvider.getEmail(tokenRequest.getToken()); + String newAccessToken = jwtProvider.createToken(email, tokenPeriodProperties.getAccess()); + String newRefreshToken = jwtProvider.createToken(email, tokenPeriodProperties.getRefresh()); token.update(newAccessToken, newRefreshToken); tokenRepository.save(token);//redis의 경우 jpa와 달리 transactional을 μ΄μš©ν•΄λ„ 데이터 μˆ˜μ •μ‹œμ— λͺ…μ‹œμ μœΌλ‘œ saveλ₯Ό ν•΄μ€˜μ•Ό 함 return RefreshTokenResponse.of(newAccessToken, newRefreshToken); @@ -99,10 +98,10 @@ private GetTokenResponse getTokenResponse(String email) { .orElseThrow(WrongAccessTokenException::new); return GetTokenResponse.of(token.getAccessToken(), token.getRefreshToken(), isNewMember); } else { - String refreshToken = jwtUtil.createToken(email, tokenPeriodProperties.getRefresh()); - String accessToken = jwtUtil.createToken(email, tokenPeriodProperties.getAccess()); + String refreshToken = jwtProvider.createToken(email, tokenPeriodProperties.getRefresh()); + String accessToken = jwtProvider.createToken(email, tokenPeriodProperties.getAccess()); Token token = tokenRepository.save(Token.of(email, accessToken, refreshToken)); return GetTokenResponse.of(token.getAccessToken(), token.getRefreshToken(), isNewMember); } } -} +} \ No newline at end of file diff --git a/daepiro-auth/src/main/java/com/numberone/backend/domain/service/UserAuthService.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/UserAuthService.java new file mode 100644 index 00000000..e3531613 --- /dev/null +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/UserAuthService.java @@ -0,0 +1,5 @@ +package com.numberone.backend.domain.service; + +public class UserAuthService { + // todo: api λͺ¨λ“ˆμ˜ token service λ₯Ό auth λͺ¨λ“ˆλ‘œ 이관 +} diff --git a/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java similarity index 62% rename from src/main/java/com/numberone/backend/domain/token/controller/TokenController.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java index d9eeb6d7..8ff421ba 100644 --- a/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java @@ -1,10 +1,10 @@ package com.numberone.backend.domain.token.controller; +import com.numberone.backend.domain.service.TokenService; import com.numberone.backend.domain.token.dto.request.GetTokenRequest; import com.numberone.backend.domain.token.dto.request.RefreshTokenRequest; import com.numberone.backend.domain.token.dto.response.GetTokenResponse; import com.numberone.backend.domain.token.dto.response.RefreshTokenResponse; -import com.numberone.backend.domain.token.service.TokenService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; @@ -23,12 +23,12 @@ public class TokenController { @Operation(summary = "카카였 토큰을 μ΄μš©ν•˜μ—¬ μ„œλ²„ JWT 토큰 λ°œκΈ‰λ°›κΈ°", description = """ - 카카였 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. - - μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. - - 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. - """) + 카카였 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. + + μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. + + 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. + """) @PostMapping("/kakao") public GetTokenResponse loginKakao(@RequestBody @Valid GetTokenRequest tokenRequest) { return tokenService.loginKakao(tokenRequest); @@ -36,12 +36,12 @@ public GetTokenResponse loginKakao(@RequestBody @Valid GetTokenRequest tokenRequ @Operation(summary = "넀이버 토큰을 μ΄μš©ν•˜μ—¬ μ„œλ²„ JWT 토큰 λ°œκΈ‰λ°›κΈ°", description = """ - 넀이버 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. - - μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. - - 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. - """) + 넀이버 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. + + μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. + + 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. + """) @PostMapping("/naver") public GetTokenResponse loginNaver(@RequestBody @Valid GetTokenRequest tokenRequest) { return tokenService.loginNaver(tokenRequest); @@ -49,10 +49,10 @@ public GetTokenResponse loginNaver(@RequestBody @Valid GetTokenRequest tokenRequ @Operation(summary = "만료된 JWT 토큰 κ°±μ‹ ν•˜κΈ°", description = """ - 만료된 JWT 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. - - μƒˆλ‘œ μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. - """) + 만료된 JWT 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. + + μƒˆλ‘œ μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. + """) @PostMapping("/refresh") public RefreshTokenResponse refresh(@RequestBody @Valid RefreshTokenRequest tokenRequest) { return tokenService.refresh(tokenRequest); diff --git a/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java similarity index 79% rename from src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java index 4f3e07f0..5bed0f3b 100644 --- a/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java @@ -1,7 +1,10 @@ package com.numberone.backend.domain.token.dto.request; import jakarta.validation.constraints.NotNull; -import lombok.*; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import org.hibernate.annotations.Comment; @ToString diff --git a/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java diff --git a/daepiro-common/build.gradle b/daepiro-common/build.gradle new file mode 100644 index 00000000..85f609fd --- /dev/null +++ b/daepiro-common/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' + id "java-library" + id "java-test-fixtures" +} + +dependencies { + + // spring + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + + // aop + implementation 'org.springframework.boot:spring-boot-starter-aop' + + // fcm + implementation 'com.google.firebase:firebase-admin:9.1.1' + + //geocoding + implementation 'com.google.code.geocoder-java:geocoder-java:0.16' +} + +tasks.bootJar { + enabled = false +} + diff --git a/src/main/java/com/numberone/backend/config/AspectConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/AspectConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/AspectConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/AspectConfig.java diff --git a/src/main/java/com/numberone/backend/config/FirebaseConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/FirebaseConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/FirebaseConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/FirebaseConfig.java diff --git a/src/main/java/com/numberone/backend/config/RestTemplateConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/RestTemplateConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/RestTemplateConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/RestTemplateConfig.java diff --git a/src/main/java/com/numberone/backend/config/S3Config.java b/daepiro-common/src/main/java/com/numberone/backend/config/S3Config.java similarity index 100% rename from src/main/java/com/numberone/backend/config/S3Config.java rename to daepiro-common/src/main/java/com/numberone/backend/config/S3Config.java diff --git a/src/main/java/com/numberone/backend/config/SchedulingConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/SchedulingConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/SchedulingConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/SchedulingConfig.java diff --git a/src/main/java/com/numberone/backend/config/SwaggerConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java similarity index 96% rename from src/main/java/com/numberone/backend/config/SwaggerConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java index c71942b4..dd0863c1 100644 --- a/src/main/java/com/numberone/backend/config/SwaggerConfig.java +++ b/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java @@ -15,7 +15,7 @@ @OpenAPIDefinition( servers = @Server(url = "/", description = "${host.url}"), info = @Info( - title = "πŸš€ λŒ€ν”Όλ‘œ λ°±μ—”λ“œ API λͺ…μ„Έμ„œ Jib 배포 23. 11. 18. v2 (jdk base image = openjdk:17-alpine)", + title = "πŸš€ λŒ€ν”Όλ‘œ λ°±μ—”λ“œ API λͺ…μ„Έμ„œ (updated at: 2024. 02. 18.)", description = """ spring docs λ₯Ό μ΄μš©ν•œ API λͺ…μ„Έμ„œ μž…λ‹ˆλ‹€.😊 """, diff --git a/src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java b/daepiro-common/src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java diff --git a/src/main/java/com/numberone/backend/exception/NumberOneException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/NumberOneException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/NumberOneException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/NumberOneException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java similarity index 83% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java index e86bba4b..51dd3ffb 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.BAD_REQUEST_CONVERSATION_SORT; public class BadRequestConversationSortException extends BadRequestException{ diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java index 51307f97..ffc6c987 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java @@ -1,7 +1,7 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; import com.numberone.backend.exception.NumberOneException; +import com.numberone.backend.exception.context.ExceptionContext; import lombok.Getter; import org.springframework.http.HttpStatus; diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java index 14dc35f5..2ca65186 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.BAD_REQUEST_HEART; public class BadRequestHeartException extends BadRequestException{ diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java similarity index 83% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java index a78ebfe3..75549086 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.BAD_REQUEST_SOCIAL_TOKEN; public class BadRequestSocialTokenException extends BadRequestException{ diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/ConflictException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/ConflictException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/ConflictException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/ConflictException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java diff --git a/src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java b/daepiro-common/src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java diff --git a/src/main/java/com/numberone/backend/exception/context/ExceptionContext.java b/daepiro-common/src/main/java/com/numberone/backend/exception/context/ExceptionContext.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/context/ExceptionContext.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/context/ExceptionContext.java diff --git a/src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java b/daepiro-common/src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java diff --git a/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java similarity index 82% rename from src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java index ad7b8ee3..ade0d66b 100644 --- a/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.forbidden; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.EXPIRED_ACCESS_TOKEN; public class ExpiredAccessTokenException extends ForbiddenException{ diff --git a/src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java diff --git a/src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java similarity index 80% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java index 565ca7da..313d4cc8 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_API; public class NotFoundApiException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java similarity index 82% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java index 8ca37e93..a9cc455f 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_CONVERSATION; public class NotFoundConversationException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java index 9bf2a9ad..0552a4af 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_CRAWLING; public class NotFoundCrawlingException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java index c58872f1..91d3595f 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_DISASTER; public class NotFoundDisasterException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java index ce72f7cc..41e0d071 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java @@ -1,7 +1,7 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; import com.numberone.backend.exception.NumberOneException; +import com.numberone.backend.exception.context.ExceptionContext; import lombok.Getter; import org.springframework.http.HttpStatus; diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java similarity index 82% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java index 63d5f6b6..adeab696 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_FRIENDSHIP; public class NotFoundFriendshipException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java index 85958b7e..ad057c7b 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.forbidden.ForbiddenException; - import static com.numberone.backend.exception.context.CustomExceptionContext.WRONG_REFRESH_TOKEN; public class NotFoundRefreshTokenException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java diff --git a/src/main/java/com/numberone/backend/properties/DisasterProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/DisasterProperties.java similarity index 86% rename from src/main/java/com/numberone/backend/properties/DisasterProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/DisasterProperties.java index db3b9aaa..4032b55b 100644 --- a/src/main/java/com/numberone/backend/properties/DisasterProperties.java +++ b/daepiro-common/src/main/java/com/numberone/backend/properties/DisasterProperties.java @@ -3,10 +3,9 @@ import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; @Data -@Service +@Component @ConfigurationProperties(prefix = "disaster") public class DisasterProperties { private String apiUrl; diff --git a/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoMapProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoMapProperties.java new file mode 100644 index 00000000..d72125ff --- /dev/null +++ b/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoMapProperties.java @@ -0,0 +1,13 @@ +package com.numberone.backend.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@Component +@ConfigurationProperties(prefix = "spring.kakao.map") +public class KakaoMapProperties { + private String client_id; + private String mapApiUrl; +} diff --git a/src/main/java/com/numberone/backend/properties/RedisProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/RedisProperties.java similarity index 100% rename from src/main/java/com/numberone/backend/properties/RedisProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/RedisProperties.java diff --git a/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/dto/FcmNotificationDto.java similarity index 91% rename from src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/fcm/dto/FcmNotificationDto.java index 2efa4c6a..788433ce 100644 --- a/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/dto/FcmNotificationDto.java @@ -1,4 +1,4 @@ -package com.numberone.backend.support.fcm.dto; +package com.numberone.backend.provider.fcm.dto; import lombok.*; diff --git a/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/service/FcmMessageProvider.java similarity index 80% rename from src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/fcm/service/FcmMessageProvider.java index ade845d5..263bc175 100644 --- a/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/service/FcmMessageProvider.java @@ -1,18 +1,13 @@ -package com.numberone.backend.support.fcm.service; +package com.numberone.backend.provider.fcm.service; import com.google.firebase.messaging.*; -import com.numberone.backend.domain.member.entity.Member; -import com.numberone.backend.domain.notification.entity.NotificationTag; import lombok.RequiredArgsConstructor; -import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; -import org.checkerframework.checker.units.qual.A; import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.stream.IntStream; @Slf4j @@ -20,13 +15,7 @@ @RequiredArgsConstructor public class FcmMessageProvider { - public void sendFcm(Member member, String title, String body, NotificationTag tag) { - String token = member.getFcmToken(); - if (Objects.isNull(token)) { - log.error("ν•΄λ‹Ή νšŒμ›μ˜ fcm 토큰이 μ‘΄μž¬ν•˜μ§€ μ•Šμ•„, ν‘Έμ‹œμ•ŒλžŒμ„ 전솑할 수 μ—†μŠ΅λ‹ˆλ‹€."); - // todo : μ˜ˆμ™Έ 핸듀링 - return; - } + public void sendFcm(String token, String title, String body) { Message message = Message.builder() .putData("time", LocalDateTime.now().toString()) @@ -48,7 +37,7 @@ public void sendFcm(Member member, String title, String body, NotificationTag ta } } - public void sendFcmToMembers(List tokens, String title, String body, NotificationTag tag) { + public void sendFcmToMembers(List tokens, String title, String body) { log.info("{} 건의 ν‘Έμ‹œμ•ŒλžŒμ„ μ „μ†‘ν•©λ‹ˆλ‹€.", tokens.size()); if (tokens.isEmpty()) return; List messages = tokens.stream().map( diff --git a/src/main/java/com/numberone/backend/util/LocationProvider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java similarity index 85% rename from src/main/java/com/numberone/backend/util/LocationProvider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java index ba0c2efb..b622f6f3 100644 --- a/src/main/java/com/numberone/backend/util/LocationProvider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java @@ -1,7 +1,7 @@ -package com.numberone.backend.util; +package com.numberone.backend.provider.location; -import com.numberone.backend.properties.KakaoProperties; -import com.numberone.backend.util.dto.MapApiResponse; +import com.numberone.backend.properties.KakaoMapProperties; +import com.numberone.backend.provider.location.dto.MapApiResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpEntity; @@ -17,7 +17,7 @@ @RequiredArgsConstructor @Slf4j public class LocationProvider { - private final KakaoProperties kakaoProperties; + private final KakaoMapProperties kakaoProperties; private final RestTemplate restTemplate; public String pos2address(double latitude, double longitude) { diff --git a/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java b/daepiro-common/src/main/java/com/numberone/backend/provider/location/dto/MapApiResponse.java similarity index 95% rename from src/main/java/com/numberone/backend/util/dto/MapApiResponse.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/location/dto/MapApiResponse.java index f52de2f9..7a37a94c 100644 --- a/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/location/dto/MapApiResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.util.dto; +package com.numberone.backend.provider.location.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/numberone/backend/support/s3/S3Provider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/s3/S3Provider.java similarity index 98% rename from src/main/java/com/numberone/backend/support/s3/S3Provider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/s3/S3Provider.java index c76c82f2..f7fcc78d 100644 --- a/src/main/java/com/numberone/backend/support/s3/S3Provider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/s3/S3Provider.java @@ -1,4 +1,4 @@ -package com.numberone.backend.support.s3; +package com.numberone.backend.provider.s3; import com.amazonaws.HttpMethod; import com.amazonaws.services.s3.AmazonS3Client; diff --git a/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/security/SecurityContextProvider.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/security/SecurityContextProvider.java index 42a23e75..2e4697ae 100644 --- a/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/security/SecurityContextProvider.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.token.util; +package com.numberone.backend.provider.security; import com.numberone.backend.exception.badrequest.BadUserAuthenticationException; import org.springframework.security.core.Authentication; diff --git a/daepiro-core/build.gradle b/daepiro-core/build.gradle new file mode 100644 index 00000000..7fb37abf --- /dev/null +++ b/daepiro-core/build.gradle @@ -0,0 +1,79 @@ +buildscript { + ext { + queryDslVersion = "5.0.0" + } +} + +plugins { + id 'java' + id "java-library" + id "java-test-fixtures" + id "maven-publish" +} + +configurations { + compileOnly { + extendsFrom annotationProcessor + } +} + +repositories { + mavenCentral() +} + +bootJar { + enabled = false +} + +jar { + enabled = true +} + +dependencies { + implementation project(':daepiro-common') + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + // p6spy + implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.8' + + // validation + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // jpa + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + // lombok + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' + + // mysql connector + runtimeOnly 'com.mysql:mysql-connector-j' + + // === QueryDsl === + implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' + annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" + annotationProcessor "jakarta.annotation:jakarta.annotation-api" + annotationProcessor "jakarta.persistence:jakarta.persistence-api" + // === QueryDsl === +} + +tasks.named('test') { + useJUnitPlatform() +} + +// === Querydsl λΉŒλ“œ μ˜΅μ…˜ === +def querydslDir = "$buildDir/generated/querydsl" + +sourceSets { + main.java.srcDirs += [ querydslDir ] +} + +tasks.withType(JavaCompile) { + options.annotationProcessorGeneratedSourcesDirectory = file(querydslDir) +} + +clean.doLast { + file(querydslDir).deleteDir() +} \ No newline at end of file diff --git a/src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java b/daepiro-core/src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java similarity index 100% rename from src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java rename to daepiro-core/src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java diff --git a/src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java b/daepiro-core/src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java similarity index 100% rename from src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java rename to daepiro-core/src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java diff --git a/src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java b/daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java rename to daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java diff --git a/src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java b/daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java similarity index 100% rename from src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java rename to daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java diff --git a/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java similarity index 93% rename from src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java index 9ca386ba..57370d63 100644 --- a/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.admin.dto.response; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.ShelterType; import com.querydsl.core.annotations.QueryProjection; import lombok.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/admin/event/CreateDisasterEventDto.java b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/event/CreateDisasterEventDto.java new file mode 100644 index 00000000..975d634a --- /dev/null +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/event/CreateDisasterEventDto.java @@ -0,0 +1,17 @@ +package com.numberone.backend.domain.admin.event; + +import com.numberone.backend.domain.disaster.DisasterType; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@ToString +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class CreateDisasterEventDto { + DisasterType type; + String location; + String message; + Long disasterNum; +} diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameter.java similarity index 86% rename from src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameter.java index 4f0995a3..ed40df71 100644 --- a/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameter.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.article.dto.response; +package com.numberone.backend.domain.article.dto.parameter; import com.numberone.backend.domain.article.entity.ArticleTag; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/entity/Article.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/Article.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/entity/Article.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/Article.java diff --git a/src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java diff --git a/src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java diff --git a/src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java diff --git a/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java similarity index 82% rename from src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java index 7b65f173..298478db 100644 --- a/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.article.repository.custom; -import com.numberone.backend.domain.article.dto.response.ArticleSearchParameter; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameter; import com.numberone.backend.domain.article.dto.response.GetArticleListResponse; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; diff --git a/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java index 41dc34df..a3573351 100644 --- a/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.article.repository.custom; -import com.numberone.backend.domain.article.dto.response.ArticleSearchParameter; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameter; import com.numberone.backend.domain.article.dto.response.GetArticleListResponse; import com.numberone.backend.domain.article.dto.response.QGetArticleListResponse; import com.numberone.backend.domain.article.entity.ArticleStatus; diff --git a/src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java diff --git a/src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java diff --git a/src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java diff --git a/src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/GetCommentDto.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/GetCommentDto.java index 30bafbc0..73a9a2ea 100644 --- a/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/GetCommentDto.java @@ -1,7 +1,6 @@ -package com.numberone.backend.domain.comment.dto.response; +package com.numberone.backend.domain.comment.dto; import com.fasterxml.jackson.annotation.JsonFormat; -import com.numberone.backend.domain.article.entity.Article; import com.numberone.backend.domain.comment.entity.CommentEntity; import com.numberone.backend.domain.member.entity.Member; import com.querydsl.core.annotations.QueryProjection; diff --git a/src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java diff --git a/src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java diff --git a/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java similarity index 76% rename from src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java index 66adfcbf..3cf19e81 100644 --- a/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.comment.repository.custom; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; import java.util.List; diff --git a/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java similarity index 87% rename from src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java index ce15479f..ffca5f0c 100644 --- a/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java @@ -1,8 +1,7 @@ package com.numberone.backend.domain.comment.repository.custom; -import com.numberone.backend.domain.article.entity.QArticle; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; -import com.numberone.backend.domain.comment.dto.response.QGetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; +import com.numberone.backend.domain.comment.dto.QGetCommentDto; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; diff --git a/src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/DisasterType.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/DisasterType.java index 65c83416..706f7f48 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/DisasterType.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.disaster.util; +package com.numberone.backend.domain.disaster; import com.numberone.backend.exception.badrequest.InvalidDisasterTypeException; import lombok.Getter; diff --git a/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java similarity index 91% rename from src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java index 3493dcc0..189ffded 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java @@ -2,9 +2,12 @@ import com.numberone.backend.config.basetime.BaseTimeEntity; import com.numberone.backend.domain.conversation.entity.Conversation; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import jakarta.persistence.*; -import lombok.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; import org.hibernate.annotations.Comment; import java.time.LocalDateTime; diff --git a/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java similarity index 91% rename from src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java index 3ac91e75..d1759514 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.disaster.event; import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java similarity index 89% rename from src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java index e51a067d..79e6cb1c 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java @@ -1,11 +1,9 @@ package com.numberone.backend.domain.disaster.repository; import com.numberone.backend.domain.disaster.entity.Disaster; -import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import javax.swing.text.html.Option; import java.time.LocalDateTime; import java.util.List; import java.util.Optional; diff --git a/src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java similarity index 87% rename from src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java index 7887ce97..cbe68e2e 100644 --- a/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java @@ -4,8 +4,6 @@ import com.numberone.backend.domain.member.entity.Member; import org.springframework.data.jpa.repository.JpaRepository; -import javax.swing.text.html.Option; -import java.util.List; import java.util.Optional; public interface FriendshipRepository extends JpaRepository { diff --git a/src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java diff --git a/src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java diff --git a/src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java diff --git a/src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java diff --git a/src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java diff --git a/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java similarity index 91% rename from src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java index 81f0bf81..a95c6e64 100644 --- a/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java @@ -4,7 +4,6 @@ import com.numberone.backend.domain.like.entity.ConversationLike; import com.numberone.backend.domain.member.entity.Member; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; import java.util.Optional; diff --git a/src/main/java/com/numberone/backend/domain/member/entity/Member.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/entity/Member.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/entity/Member.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/entity/Member.java diff --git a/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java index 719544d8..f19f86e5 100644 --- a/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java @@ -3,7 +3,6 @@ import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.repository.custom.MemberRepositoryCustom; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; diff --git a/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java diff --git a/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java diff --git a/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/parameter/NotificationSearchParameter.java similarity index 76% rename from src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/parameter/NotificationSearchParameter.java index afff1e7b..2d7267d3 100644 --- a/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/parameter/NotificationSearchParameter.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.notification.dto.request; +package com.numberone.backend.domain.notification.dto.parameter; import lombok.*; @@ -10,4 +10,5 @@ public class NotificationSearchParameter { Long lastNotificationId; Boolean isDisaster; + } diff --git a/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java index db91b72c..f2a1be42 100644 --- a/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.numberone.backend.domain.notification.entity.NotificationEntity; -import com.numberone.backend.domain.notification.entity.NotificationTag; import com.querydsl.core.annotations.QueryProjection; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java index e59c4aee..f3fdf0d8 100644 --- a/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.notification.entity; import com.numberone.backend.config.basetime.BaseTimeEntity; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.entity.Member; import jakarta.persistence.*; import lombok.AccessLevel; @@ -9,8 +9,6 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.Comment; -import java.util.MissingFormatArgumentException; - @Comment("μ•Œλ¦Ό 정보") @NoArgsConstructor(access = AccessLevel.PROTECTED) @Getter diff --git a/src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java diff --git a/src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java diff --git a/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java similarity index 82% rename from src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java index 5a889f1d..fbd75028 100644 --- a/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.notification.repository.custom; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; diff --git a/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java index 7dab3ffb..0a879761 100644 --- a/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java @@ -1,11 +1,10 @@ package com.numberone.backend.domain.notification.repository.custom; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import com.numberone.backend.domain.notification.dto.response.QNotificationTabResponse; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.querydsl.core.types.dsl.BooleanExpression; -import com.querydsl.core.types.dsl.CaseBuilder; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; import org.springframework.data.domain.Pageable; @@ -42,8 +41,8 @@ public Slice getNotificationTabPagesNoOffSetByMember(No return checkLastPage(pageable, result); } - private BooleanExpression checkDisasterFlag(boolean isDisaster){ - if (!isDisaster){ + private BooleanExpression checkDisasterFlag(boolean isDisaster) { + if (!isDisaster) { return notificationEntity.notificationTag.ne(NotificationTag.DISASTER); } return notificationEntity.notificationTag.eq(NotificationTag.DISASTER); diff --git a/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java index 650272b6..ccc3dc54 100644 --- a/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.notificationdisaster.entity; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.entity.Member; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java diff --git a/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java index 5d9cee4e..d8979836 100644 --- a/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java @@ -1,7 +1,6 @@ package com.numberone.backend.domain.notificationregion.entity; import com.numberone.backend.domain.member.entity.Member; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.persistence.*; import lombok.AccessLevel; import lombok.Builder; diff --git a/src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/util/Address.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/Address.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/shelter/util/Address.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/Address.java index 08dfd0f4..7759e9a3 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/util/Address.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/Address.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.util; +package com.numberone.backend.domain.shelter; import jakarta.persistence.Embeddable; import lombok.Getter; diff --git a/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterStatus.java similarity index 76% rename from src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterStatus.java index b7bbe303..8f4a4bde 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterStatus.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.util; +package com.numberone.backend.domain.shelter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterType.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterType.java index 78d01d07..1bba4f1b 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterType.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.util; +package com.numberone.backend.domain.shelter; import com.numberone.backend.exception.badrequest.InvalidShelterTypeException; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/GetAllSheltersResponse.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/GetAllSheltersResponse.java index c1168b08..304aa918 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/GetAllSheltersResponse.java @@ -1,6 +1,5 @@ -package com.numberone.backend.domain.shelter.dto.response; +package com.numberone.backend.domain.shelter.dto; -import com.numberone.backend.domain.shelter.util.Address; import com.querydsl.core.annotations.QueryProjection; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/ShelterMapper.java similarity index 72% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/ShelterMapper.java index 82098d25..efca4e4c 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/ShelterMapper.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.dto.response; +package com.numberone.backend.domain.shelter.dto; public interface ShelterMapper { Long getId(); diff --git a/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java similarity index 85% rename from src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java index 83fbec73..0f3460ba 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java @@ -1,9 +1,9 @@ package com.numberone.backend.domain.shelter.entity; import com.numberone.backend.config.basetime.BaseTimeEntity; -import com.numberone.backend.domain.shelter.util.Address; -import com.numberone.backend.domain.shelter.util.ShelterStatus; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.Address; +import com.numberone.backend.domain.shelter.ShelterStatus; +import com.numberone.backend.domain.shelter.ShelterType; import jakarta.persistence.*; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java index c344d803..7f19408d 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.shelter.repository; -import com.numberone.backend.domain.shelter.dto.response.ShelterMapper; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import com.numberone.backend.domain.shelter.entity.Shelter; import com.numberone.backend.domain.shelter.repository.custom.CustomShelterRepository; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java similarity index 80% rename from src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java index ae837a33..0e54f7c5 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.shelter.repository.custom; import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; -import com.numberone.backend.domain.shelter.dto.response.GetAllSheltersResponse; +import com.numberone.backend.domain.shelter.dto.GetAllSheltersResponse; import java.util.List; diff --git a/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java similarity index 90% rename from src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java index a4aaae7a..fdf7ce5a 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java @@ -2,11 +2,11 @@ import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; import com.numberone.backend.domain.admin.dto.response.QGetAddressResponse; -import com.numberone.backend.domain.shelter.dto.response.GetAllSheltersResponse; -import com.numberone.backend.domain.shelter.dto.response.QGetAllSheltersResponse_AddressDetail; -import com.numberone.backend.domain.shelter.dto.response.QGetAllSheltersResponse_ShelterDetail; -import com.numberone.backend.domain.shelter.util.ShelterStatus; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.ShelterStatus; +import com.numberone.backend.domain.shelter.ShelterType; +import com.numberone.backend.domain.shelter.dto.GetAllSheltersResponse; +import com.numberone.backend.domain.shelter.dto.QGetAllSheltersResponse_AddressDetail; +import com.numberone.backend.domain.shelter.dto.QGetAllSheltersResponse_ShelterDetail; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; diff --git a/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java index 3623cd98..0d3e174b 100644 --- a/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.sponsor.entity; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.support.entity.Support; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java diff --git a/src/main/java/com/numberone/backend/domain/support/entity/Support.java b/daepiro-core/src/main/java/com/numberone/backend/domain/support/entity/Support.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/entity/Support.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/support/entity/Support.java diff --git a/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java index 0f2fad79..ee2a87bb 100644 --- a/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java @@ -4,8 +4,6 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import java.util.List; - public interface SupportRepository extends JpaRepository { @Query("select count(distinct s.member.id) from Support s") long getSupportCnt(); diff --git a/daepiro-crawler/build.gradle b/daepiro-crawler/build.gradle new file mode 100644 index 00000000..72bcdb0d --- /dev/null +++ b/daepiro-crawler/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id "java-library" + id "java-test-fixtures" +} + +dependencies { + implementation project(':daepiro-common') + implementation project(':daepiro-core') + + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // jpa + api 'org.springframework.boot:spring-boot-starter-data-jpa' + + //crawling + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'org.jsoup:jsoup:1.14.2' + implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' +} + +tasks.bootJar { + enabled = false +} + diff --git a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java similarity index 81% rename from src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java rename to daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java index 7352750e..3a2277a6 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java +++ b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java @@ -4,37 +4,34 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; -import com.numberone.backend.domain.disaster.dto.response.DisasterDataResponse; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.disaster.entity.Disaster; +import com.numberone.backend.domain.disaster.event.DisasterEvent; import com.numberone.backend.domain.disaster.repository.DisasterRepository; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.service.dto.DisasterDataResponse; +import com.numberone.backend.domain.disaster.service.dto.SaveDisasterRequest; import com.numberone.backend.exception.notfound.NotFoundApiException; import com.numberone.backend.exception.notfound.NotFoundCrawlingException; import com.numberone.backend.properties.DisasterProperties; -import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.springframework.context.ApplicationEventPublisher; -import org.springframework.http.*; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter; import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import java.io.IOException; import java.net.URI; import java.time.LocalDateTime; -import java.util.*; +import java.time.format.DateTimeFormatter; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @Service @RequiredArgsConstructor @@ -44,19 +41,10 @@ public class DisasterDataCollector { private final DisasterProperties disasterProperties; private final ObjectMapper objectMapper; private final DisasterRepository disasterRepository; - private final DisasterService disasterService; + private final ApplicationEventPublisher eventPublisher; private Long latestDisasterNum = 0L; private Map disasterTypeMap = new HashMap<>(); - @PostConstruct - public void init() { - disasterRepository.findTopByOrderByDisasterNumDesc().ifPresent( - disaster -> { - latestDisasterNum = disaster.getDisasterNum(); - } - ); - log.info("init latestDisasterNum = " + latestDisasterNum); - } @Scheduled(fixedDelay = 60 * 1000) public void collectData() { @@ -94,7 +82,7 @@ public void collectData() { if (disasterTypeMap.get(disasterNum).equals(DisasterType.OTHERS) && (disaster.getMsg().contains("μ‹€μ’…") || disaster.getMsg().contains("λͺ©κ²©") || disaster.getMsg().contains("배회"))) disasterTypeMap.put(disasterNum, DisasterType.MISSING); - disasterService.save(SaveDisasterRequest.of( + convertAndSave(SaveDisasterRequest.of( disasterTypeMap.get(disasterNum), loc.replace(" 전체", ""),//이 뢀뢄은 λ©”μ‹œμ§€ λ‚΄λΆ€ νŒŒμ‹±ν•˜μ—¬ 더 μ •ν™•ν•œ μ£Όμ†Œλ₯Ό μ €μž₯ν•˜λ„λ‘ μˆ˜μ •ν•΄μ•Όν•¨ disaster.getMsg(), @@ -107,6 +95,23 @@ public void collectData() { } } + private void convertAndSave(SaveDisasterRequest saveDisasterRequest) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + LocalDateTime dateTime = LocalDateTime.parse(saveDisasterRequest.getCreatedAt(), formatter); + Disaster savedDisaster = + disasterRepository.save( + Disaster.of( + saveDisasterRequest.getDisasterType(), + saveDisasterRequest.getLocation(), + saveDisasterRequest.getMsg(), + saveDisasterRequest.getDisasterNum(), + dateTime + ) + ); + log.info("μž¬λ‚œ λ°œμƒ 이벀트 λ°œν–‰"); + eventPublisher.publishEvent(DisasterEvent.of(savedDisaster)); // μ‹ κ·œ μž¬λ‚œ λ°œμƒ 이벀트 + } + // private void crawlingDisasterType() { // disasterTypeMap.clear(); // WebClient webClient = new WebClient(); diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/DisasterDataResponse.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java rename to daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/DisasterDataResponse.java index db12e376..58de460c 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java +++ b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/DisasterDataResponse.java @@ -1,9 +1,8 @@ -package com.numberone.backend.domain.disaster.dto.response; +package com.numberone.backend.domain.disaster.service.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AccessLevel; -import lombok.Data; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/SaveDisasterRequest.java b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/SaveDisasterRequest.java new file mode 100644 index 00000000..9d36135d --- /dev/null +++ b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/SaveDisasterRequest.java @@ -0,0 +1,27 @@ +package com.numberone.backend.domain.disaster.service.dto; + +import com.numberone.backend.domain.disaster.DisasterType; +import lombok.*; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +@Builder +public class SaveDisasterRequest { + + private DisasterType disasterType; + private String location; + private String msg; + private Long disasterNum; + private String createdAt; + + public static SaveDisasterRequest of(DisasterType disasterType, String location, String msg, Long disasterNum, String createdAt) { + return SaveDisasterRequest.builder() + .disasterType(disasterType) + .location(location) + .msg(msg) + .disasterNum(disasterNum) + .createdAt(createdAt) + .build(); + } +} diff --git a/daepiro-redis/build.gradle b/daepiro-redis/build.gradle new file mode 100644 index 00000000..7d95f7a4 --- /dev/null +++ b/daepiro-redis/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java' + id "java-library" + id "java-test-fixtures" +} + +dependencies { + implementation project(':daepiro-common') + + // redis + implementation 'org.springframework.boot:spring-boot-starter-data-redis' + + // test + testFixturesRuntimeOnly group: 'it.ozimov', name: 'embedded-redis', version: '0.7.1' +} + +tasks.bootJar { + enabled = false +} diff --git a/src/main/java/com/numberone/backend/config/RedisConfig.java b/daepiro-redis/src/main/java/com/numberone/backend/config/RedisConfig.java similarity index 93% rename from src/main/java/com/numberone/backend/config/RedisConfig.java rename to daepiro-redis/src/main/java/com/numberone/backend/config/RedisConfig.java index 5c8c7ea8..8a37a980 100644 --- a/src/main/java/com/numberone/backend/config/RedisConfig.java +++ b/daepiro-redis/src/main/java/com/numberone/backend/config/RedisConfig.java @@ -7,7 +7,6 @@ import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.StringRedisSerializer; @Configuration @RequiredArgsConstructor diff --git a/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java b/daepiro-redis/src/main/java/com/numberone/backend/domain/like/repository/RedisLockRepository.java similarity index 90% rename from src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java rename to daepiro-redis/src/main/java/com/numberone/backend/domain/like/repository/RedisLockRepository.java index 8344e4ce..6efa6099 100644 --- a/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java +++ b/daepiro-redis/src/main/java/com/numberone/backend/domain/like/repository/RedisLockRepository.java @@ -1,4 +1,4 @@ -package com.numberone.backend.support.redis.like.repository; +package com.numberone.backend.domain.like.repository; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.RedisTemplate; diff --git a/src/main/java/com/numberone/backend/domain/token/entity/Token.java b/daepiro-redis/src/main/java/com/numberone/backend/domain/token/entity/Token.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/token/entity/Token.java rename to daepiro-redis/src/main/java/com/numberone/backend/domain/token/entity/Token.java index 0778a852..6f1cdbea 100644 --- a/src/main/java/com/numberone/backend/domain/token/entity/Token.java +++ b/daepiro-redis/src/main/java/com/numberone/backend/domain/token/entity/Token.java @@ -1,9 +1,7 @@ package com.numberone.backend.domain.token.entity; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; -import org.hibernate.annotations.Comment; import org.springframework.data.annotation.Id; import org.springframework.data.redis.core.RedisHash; import org.springframework.data.redis.core.index.Indexed; diff --git a/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java b/daepiro-redis/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java rename to daepiro-redis/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/settings.gradle b/settings.gradle index ab6c67b7..7cc18856 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,8 @@ rootProject.name = 'Backend' +include 'daepiro-app' +include 'daepiro-api' +include 'daepiro-core' +include 'daepiro-common' +include 'daepiro-redis' +include 'daepiro-auth' +include 'daepiro-crawler' \ No newline at end of file diff --git a/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java b/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java deleted file mode 100644 index 8c09a02d..00000000 --- a/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.numberone.backend.domain.admin.dto.request; - -import com.numberone.backend.domain.disaster.util.DisasterType; -import lombok.*; - -@ToString -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -public class CreateDisasterEventDto { - DisasterType type; - String location; - String message; - Long disasterNum; -} diff --git a/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java b/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java deleted file mode 100644 index 15f24651..00000000 --- a/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.numberone.backend.support.notification; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor -public enum NotificationMessage implements NotificationMessageSpec { - - ARTICLE_COMMENT_FCM_ALARM("[λŒ€ν”Όλ‘œ μ•Œλ¦Ό]", "κ²Œμ‹œκΈ€μ— λŒ“κΈ€μ΄ λ‹¬λ Έμ–΄μš”!", null), - BEST_ARTICLE_FCM_ALARM("[λŒ€ν”Όλ‘œ μ•Œλ¦Ό]", "μΆ•ν•˜λ“œλ¦½λ‹ˆλ‹€! 베슀트 κ²Œμ‹œκΈ€λ‘œ μ„ μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€. πŸŽ‰", null) - ; - - private final String title; - private final String body; - private final String imageUrl; - -} diff --git a/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java b/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java deleted file mode 100644 index e9083410..00000000 --- a/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.numberone.backend.support.notification; - -public interface NotificationMessageSpec { - String getTitle(); - String getBody(); - String getImageUrl(); -} diff --git a/src/test/java/com/numberone/backend/BackendApplicationTests.java b/src/test/java/com/numberone/backend/BackendApplicationTests.java deleted file mode 100644 index 126c3eeb..00000000 --- a/src/test/java/com/numberone/backend/BackendApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.numberone.backend; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class BackendApplicationTests { - - @Test - void contextLoads() { - } - -}