diff --git a/Api/build.gradle b/Api/build.gradle index a2abfcf6..9763a42f 100644 --- a/Api/build.gradle +++ b/Api/build.gradle @@ -11,6 +11,8 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-aop' // swagger implementation 'org.springdoc:springdoc-openapi-ui:1.6.12' diff --git a/Api/src/main/java/allchive/server/api/archiving/service/UpdateArchivingUseCase.java b/Api/src/main/java/allchive/server/api/archiving/service/UpdateArchivingUseCase.java index 54f908c3..fbdc4cec 100644 --- a/Api/src/main/java/allchive/server/api/archiving/service/UpdateArchivingUseCase.java +++ b/Api/src/main/java/allchive/server/api/archiving/service/UpdateArchivingUseCase.java @@ -6,7 +6,7 @@ import allchive.server.api.config.security.SecurityUtil; import allchive.server.core.annotation.UseCase; import allchive.server.core.event.Event; -import allchive.server.core.event.events.s3.S3ImageDeleteEvent; +import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent; import allchive.server.domain.common.aop.distributedLock.DistributedLock; import allchive.server.domain.common.enums.DistributedLockType; import allchive.server.domain.domains.archiving.adaptor.ArchivingAdaptor; diff --git a/Api/src/main/java/allchive/server/api/chore/controller/ChoreController.java b/Api/src/main/java/allchive/server/api/chore/controller/ChoreController.java index 764cd98f..8906d160 100644 --- a/Api/src/main/java/allchive/server/api/chore/controller/ChoreController.java +++ b/Api/src/main/java/allchive/server/api/chore/controller/ChoreController.java @@ -27,7 +27,6 @@ public void errorExample( @Operation(hidden = true) @GetMapping(value = "health") - public ResponseEntity errorExample() { - return ResponseEntity.ok().build(); + public void healthCheck() { } } diff --git a/Api/src/main/java/allchive/server/api/common/filter/MultiReadInputStream.java b/Api/src/main/java/allchive/server/api/common/filter/MultiReadInputStream.java index f75f1c7a..5e4eef3a 100644 --- a/Api/src/main/java/allchive/server/api/common/filter/MultiReadInputStream.java +++ b/Api/src/main/java/allchive/server/api/common/filter/MultiReadInputStream.java @@ -1,7 +1,8 @@ package allchive.server.api.common.filter; -import com.amazonaws.util.IOUtils; +import org.apache.tomcat.util.http.fileupload.IOUtils; + import java.io.*; import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; diff --git a/Api/src/main/java/allchive/server/api/config/GlobalExceptionHandler.java b/Api/src/main/java/allchive/server/api/config/GlobalExceptionHandler.java index 9d4d500c..3d7f4aa2 100644 --- a/Api/src/main/java/allchive/server/api/config/GlobalExceptionHandler.java +++ b/Api/src/main/java/allchive/server/api/config/GlobalExceptionHandler.java @@ -8,7 +8,7 @@ import allchive.server.core.error.ErrorResponse; import allchive.server.core.error.GlobalErrorCode; import allchive.server.core.event.Event; -import allchive.server.core.event.events.slack.SlackErrorEvent; +import allchive.server.infrastructure.slack.event.SlackErrorEvent; import java.util.List; import java.util.Map; import java.util.stream.Collectors; diff --git a/Api/src/main/java/allchive/server/api/content/service/UpdateContentUseCase.java b/Api/src/main/java/allchive/server/api/content/service/UpdateContentUseCase.java index 1637ddf5..c5b892dc 100644 --- a/Api/src/main/java/allchive/server/api/content/service/UpdateContentUseCase.java +++ b/Api/src/main/java/allchive/server/api/content/service/UpdateContentUseCase.java @@ -9,7 +9,7 @@ import allchive.server.api.content.model.mapper.ContentMapper; import allchive.server.core.annotation.UseCase; import allchive.server.core.event.Event; -import allchive.server.core.event.events.s3.S3ImageDeleteEvent; +import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent; import allchive.server.domain.common.aop.distributedLock.DistributedLock; import allchive.server.domain.common.enums.DistributedLockType; import allchive.server.domain.domains.archiving.service.ArchivingAsyncDomainService; diff --git a/Api/src/main/java/allchive/server/api/recycle/service/ClearDeletedObjectUseCase.java b/Api/src/main/java/allchive/server/api/recycle/service/ClearDeletedObjectUseCase.java index 96baf050..4452fc5b 100644 --- a/Api/src/main/java/allchive/server/api/recycle/service/ClearDeletedObjectUseCase.java +++ b/Api/src/main/java/allchive/server/api/recycle/service/ClearDeletedObjectUseCase.java @@ -4,7 +4,7 @@ import allchive.server.api.recycle.model.dto.request.ClearDeletedObjectRequest; import allchive.server.core.annotation.UseCase; import allchive.server.core.event.Event; -import allchive.server.core.event.events.s3.S3ImageDeleteEvent; +import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent; import allchive.server.domain.common.aop.distributedLock.DistributedLock; import allchive.server.domain.common.enums.DistributedLockType; import allchive.server.domain.domains.archiving.adaptor.ArchivingAdaptor; diff --git a/Api/src/main/java/allchive/server/api/recycle/service/ClearOldDeletedObjectUseCase.java b/Api/src/main/java/allchive/server/api/recycle/service/ClearOldDeletedObjectUseCase.java index e8eca4d2..991fe342 100644 --- a/Api/src/main/java/allchive/server/api/recycle/service/ClearOldDeletedObjectUseCase.java +++ b/Api/src/main/java/allchive/server/api/recycle/service/ClearOldDeletedObjectUseCase.java @@ -3,7 +3,7 @@ import allchive.server.core.annotation.UseCase; import allchive.server.core.event.Event; -import allchive.server.core.event.events.s3.S3ImageDeleteEvent; +import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent; import allchive.server.domain.domains.archiving.adaptor.ArchivingAdaptor; import allchive.server.domain.domains.archiving.domain.Archiving; import allchive.server.domain.domains.archiving.service.ArchivingDomainService; diff --git a/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java b/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java index f148d8b5..fbae0ea6 100644 --- a/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java +++ b/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java @@ -1,7 +1,7 @@ package allchive.server.api.search.service; +import static allchive.server.core.consts.AllchiveConst.ASTERISK; import static allchive.server.core.consts.AllchiveConst.SEARCH_KEY; -import static jodd.util.StringPool.ASTERISK; import allchive.server.api.common.util.StringParamUtil; import allchive.server.api.search.model.dto.response.SearchListResponse; diff --git a/Api/src/main/java/allchive/server/api/user/service/UpdateUserInfoUseCase.java b/Api/src/main/java/allchive/server/api/user/service/UpdateUserInfoUseCase.java index 2a536f0a..c6289da4 100644 --- a/Api/src/main/java/allchive/server/api/user/service/UpdateUserInfoUseCase.java +++ b/Api/src/main/java/allchive/server/api/user/service/UpdateUserInfoUseCase.java @@ -5,7 +5,7 @@ import allchive.server.api.user.model.dto.request.UpdateUserInfoRequest; import allchive.server.core.annotation.UseCase; import allchive.server.core.event.Event; -import allchive.server.core.event.events.s3.S3ImageDeleteEvent; +import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent; import allchive.server.domain.common.aop.distributedLock.DistributedLock; import allchive.server.domain.common.enums.DistributedLockType; import allchive.server.domain.domains.user.adaptor.UserAdaptor; diff --git a/Core/build.gradle b/Core/build.gradle index d633c34e..f67e5636 100644 --- a/Core/build.gradle +++ b/Core/build.gradle @@ -5,7 +5,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'io.jsonwebtoken:jjwt-api:0.11.5' implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2' - api 'org.springframework.boot:spring-boot-starter-web' runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5' runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' diff --git a/Domain/build.gradle b/Domain/build.gradle index a23fa539..81b129c8 100644 --- a/Domain/build.gradle +++ b/Domain/build.gradle @@ -6,7 +6,6 @@ dependencies { implementation 'mysql:mysql-connector-java:8.0.33' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation' - runtimeOnly 'com.h2database:h2' implementation project(':Core') implementation project(':Infrastructure') diff --git a/Core/src/main/java/allchive/server/core/async/CustomAsyncExceptionHandler.java b/Domain/src/main/java/allchive/server/domain/config/async/CustomAsyncExceptionHandler.java similarity index 87% rename from Core/src/main/java/allchive/server/core/async/CustomAsyncExceptionHandler.java rename to Domain/src/main/java/allchive/server/domain/config/async/CustomAsyncExceptionHandler.java index c737426c..93f41bf8 100644 --- a/Core/src/main/java/allchive/server/core/async/CustomAsyncExceptionHandler.java +++ b/Domain/src/main/java/allchive/server/domain/config/async/CustomAsyncExceptionHandler.java @@ -1,9 +1,10 @@ -package allchive.server.core.async; +package allchive.server.domain.config.async; import allchive.server.core.event.Event; -import allchive.server.core.event.events.slack.SlackAsyncErrorEvent; import java.lang.reflect.Method; + +import allchive.server.infrastructure.slack.event.SlackAsyncErrorEvent; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; diff --git a/Core/src/main/java/allchive/server/core/config/EnableAsyncConfig.java b/Domain/src/main/java/allchive/server/domain/config/async/EnableAsyncConfig.java similarity index 95% rename from Core/src/main/java/allchive/server/core/config/EnableAsyncConfig.java rename to Domain/src/main/java/allchive/server/domain/config/async/EnableAsyncConfig.java index 4d6f773b..d0f80b21 100644 --- a/Core/src/main/java/allchive/server/core/config/EnableAsyncConfig.java +++ b/Domain/src/main/java/allchive/server/domain/config/async/EnableAsyncConfig.java @@ -1,8 +1,7 @@ -package allchive.server.core.config; +package allchive.server.domain.config.async; import static allchive.server.core.consts.AllchiveConst.*; -import allchive.server.core.async.CustomAsyncExceptionHandler; import java.util.concurrent.Executor; import java.util.concurrent.ThreadPoolExecutor; import lombok.RequiredArgsConstructor; diff --git a/Domain/src/main/resources/application-domain.yml b/Domain/src/main/resources/application-domain.yml index 4f1b7ffe..6317034a 100644 --- a/Domain/src/main/resources/application-domain.yml +++ b/Domain/src/main/resources/application-domain.yml @@ -7,10 +7,10 @@ spring: activate: on-profile: local datasource: - url: jdbc:mysql://localhost:3306/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&tinyInt1isBit=false + url: jdbc:mysql://localhost:3307/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&tinyInt1isBit=false driver-class-name: com.mysql.cj.jdbc.Driver username: root - password: test + password: root hikari: maxLifetime: 580000 maximum-pool-size: 20 diff --git a/Infrastructure/build.gradle b/Infrastructure/build.gradle index dc4f5d97..29ec7597 100644 --- a/Infrastructure/build.gradle +++ b/Infrastructure/build.gradle @@ -3,12 +3,13 @@ jar { enabled = true } dependencies { api 'org.springframework.boot:spring-boot-starter-data-redis' - api 'org.redisson:redisson:3.19.0' - api 'io.github.openfeign:feign-httpclient:12.1' - api 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.4' - api 'com.amazonaws:aws-java-sdk-s3control:1.12.372' - api 'com.nimbusds:nimbus-jose-jwt:3.10' - api("com.slack.api:slack-api-client:1.28.0") + implementation 'org.redisson:redisson:3.19.0' + implementation 'io.github.openfeign:feign-httpclient:12.1' + implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.4' + implementation 'com.amazonaws:aws-java-sdk-s3control:1.12.372' + implementation 'com.nimbusds:nimbus-jose-jwt:3.10' + implementation "com.slack.api:slack-api-client:1.28.0" + implementation 'org.springframework.boot:spring-boot-starter-web' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2' diff --git a/Core/src/main/java/allchive/server/core/event/events/s3/S3ImageDeleteEvent.java b/Infrastructure/src/main/java/allchive/server/infrastructure/s3/event/S3ImageDeleteEvent.java similarity index 88% rename from Core/src/main/java/allchive/server/core/event/events/s3/S3ImageDeleteEvent.java rename to Infrastructure/src/main/java/allchive/server/infrastructure/s3/event/S3ImageDeleteEvent.java index c7916522..42737e6d 100644 --- a/Core/src/main/java/allchive/server/core/event/events/s3/S3ImageDeleteEvent.java +++ b/Infrastructure/src/main/java/allchive/server/infrastructure/s3/event/S3ImageDeleteEvent.java @@ -1,4 +1,4 @@ -package allchive.server.core.event.events.s3; +package allchive.server.infrastructure.s3.event; import java.util.List; diff --git a/Infrastructure/src/main/java/allchive/server/infrastructure/s3/service/S3DeleteObjectService.java b/Infrastructure/src/main/java/allchive/server/infrastructure/s3/service/S3DeleteObjectService.java index 2ef0854f..c8effb82 100644 --- a/Infrastructure/src/main/java/allchive/server/infrastructure/s3/service/S3DeleteObjectService.java +++ b/Infrastructure/src/main/java/allchive/server/infrastructure/s3/service/S3DeleteObjectService.java @@ -2,7 +2,7 @@ import allchive.server.core.error.exception.S3ObjectNotFoundException; -import allchive.server.core.event.events.s3.S3ImageDeleteEvent; +import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent; import com.amazonaws.services.s3.AmazonS3; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; diff --git a/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackMessageGenerater.java b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackMessageGenerater.java index 8007019f..3706561f 100644 --- a/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackMessageGenerater.java +++ b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackMessageGenerater.java @@ -4,8 +4,8 @@ import static com.slack.api.model.block.Blocks.section; import static com.slack.api.model.block.composition.BlockCompositions.plainText; -import allchive.server.core.event.events.slack.SlackAsyncErrorEvent; -import allchive.server.core.event.events.slack.SlackErrorEvent; +import allchive.server.infrastructure.slack.event.SlackAsyncErrorEvent; +import allchive.server.infrastructure.slack.event.SlackErrorEvent; import com.slack.api.model.block.Blocks; import com.slack.api.model.block.DividerBlock; import com.slack.api.model.block.HeaderBlock; diff --git a/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackSendMessageHandler.java b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackSendMessageHandler.java index 6adb2d84..97a64024 100644 --- a/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackSendMessageHandler.java +++ b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/SlackSendMessageHandler.java @@ -1,8 +1,8 @@ package allchive.server.infrastructure.slack; -import allchive.server.core.event.events.slack.SlackAsyncErrorEvent; -import allchive.server.core.event.events.slack.SlackErrorEvent; +import allchive.server.infrastructure.slack.event.SlackAsyncErrorEvent; +import allchive.server.infrastructure.slack.event.SlackErrorEvent; import com.slack.api.webhook.Payload; import java.io.IOException; import lombok.RequiredArgsConstructor; diff --git a/Core/src/main/java/allchive/server/core/event/events/slack/SlackAsyncErrorEvent.java b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/event/SlackAsyncErrorEvent.java similarity index 92% rename from Core/src/main/java/allchive/server/core/event/events/slack/SlackAsyncErrorEvent.java rename to Infrastructure/src/main/java/allchive/server/infrastructure/slack/event/SlackAsyncErrorEvent.java index f5654070..61ad4943 100644 --- a/Core/src/main/java/allchive/server/core/event/events/slack/SlackAsyncErrorEvent.java +++ b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/event/SlackAsyncErrorEvent.java @@ -1,4 +1,4 @@ -package allchive.server.core.event.events.slack; +package allchive.server.infrastructure.slack.event; import lombok.Builder; diff --git a/Core/src/main/java/allchive/server/core/event/events/slack/SlackErrorEvent.java b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/event/SlackErrorEvent.java similarity index 92% rename from Core/src/main/java/allchive/server/core/event/events/slack/SlackErrorEvent.java rename to Infrastructure/src/main/java/allchive/server/infrastructure/slack/event/SlackErrorEvent.java index 77f8bacb..c72a654c 100644 --- a/Core/src/main/java/allchive/server/core/event/events/slack/SlackErrorEvent.java +++ b/Infrastructure/src/main/java/allchive/server/infrastructure/slack/event/SlackErrorEvent.java @@ -1,4 +1,4 @@ -package allchive.server.core.event.events.slack; +package allchive.server.infrastructure.slack.event; import lombok.Builder; diff --git a/config/nginx/default.conf b/config/nginx/default.conf index e3b213a3..8f203e0c 100644 --- a/config/nginx/default.conf +++ b/config/nginx/default.conf @@ -4,10 +4,6 @@ server { autoindex_localtime on; - if ($http_x_forwarded_proto != 'https') { - return 301 https://$host$request_uri; - } - location /api { proxy_pass http://server:8080; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/config/nginx/default.prod.conf b/config/nginx/default.prod.conf index dc7de01b..aee59867 100644 --- a/config/nginx/default.prod.conf +++ b/config/nginx/default.prod.conf @@ -4,10 +4,6 @@ server { autoindex_localtime on; - if ($http_x_forwarded_proto != 'https') { - return 301 https://$host$request_uri; - } - location /api { proxy_pass http://server:8080; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 5e6e699d..fff61f67 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -15,8 +15,10 @@ services: volumes: - ./mysqldata:/var/lib/mysql environment: - - MYSQL_ROOT_PASSWORD=test + - MYSQL_USER=user + - MYSQL_PASSWORD=user + - MYSQL_ROOT_PASSWORD=root - MYSQL_HOST=localhost - - MYSQL_PORT=3306 + - MYSQL_PORT=3307 ports: - - "3306:3306" \ No newline at end of file + - "3307:3306" \ No newline at end of file