Skip to content

Commit 554b606

Browse files
authored
Merge pull request #99 from DSM-Repo/final-refactoring
pr: 패키지 구조 리팩토링
2 parents 134e04d + 8455c5f commit 554b606

File tree

267 files changed

+997
-880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+997
-880
lines changed

build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'io.spring.dependency-management' version '1.1.4'
55
}
66

7-
group = 'com.repo'
7+
group = 'com.dsm'
88
version = '0.0.1-SNAPSHOT'
99

1010
java {
@@ -42,10 +42,6 @@ dependencies {
4242
implementation 'io.jsonwebtoken:jjwt:0.9.1'
4343
implementation 'javax.xml.bind:jaxb-api:2.3.0'
4444

45-
// test
46-
testImplementation 'org.springframework.boot:spring-boot-starter-test'
47-
testImplementation 'org.springframework.security:spring-security-test'
48-
4945
// AWS
5046
implementation 'io.awspring.cloud:spring-cloud-aws-starter-s3:3.0.0'
5147

src/main/java/com/repo/whopper/Application.java renamed to src/main/java/com/dsm/repo/Application.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
package com.repo.whopper;
1+
package com.dsm.repo;
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
55
import org.springframework.boot.autoconfigure.SpringBootApplication;
66
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
77
import org.springframework.cloud.openfeign.EnableFeignClients;
88
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
9+
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
10+
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
911

12+
@EnableWebSecurity
1013
@EnableFeignClients
14+
@EnableMethodSecurity
1115
@SpringBootApplication
1216
@ConfigurationPropertiesScan
1317
@ImportAutoConfiguration({FeignAutoConfiguration.class})
14-
class Application {
18+
class Application {
1519

1620
public static void main(final String[] args) {
1721
SpringApplication.run(

src/main/java/com/repo/whopper/infrastructure/aws/s3/AwsS3Properties.java renamed to src/main/java/com/dsm/repo/external/aws/s3/AwsS3Properties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.repo.whopper.infrastructure.aws.s3;
1+
package com.dsm.repo.external.aws.s3;
22

33
import org.springframework.boot.context.properties.ConfigurationProperties;
44

src/main/java/com/repo/whopper/infrastructure/mongo/MongoUtils.java renamed to src/main/java/com/dsm/repo/external/database/mongo/MongoUtils.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
package com.repo.whopper.infrastructure.mongo;
1+
package com.dsm.repo.external.database.mongo;
22

33
import org.springframework.data.mongodb.core.BulkOperations;
44
import org.springframework.data.mongodb.core.query.Query;
55

66
import java.util.stream.Stream;
77

88
public interface MongoUtils {
9+
910
<T> Stream<T> find(Query query, Class<T> targetClass);
11+
12+
1013
<T> BulkOperations bulkOps(Class<T> targetClass);
11-
}
14+
15+
}

src/main/java/com/repo/whopper/infrastructure/mongo/MongoUtilsImpl.java renamed to src/main/java/com/dsm/repo/external/database/mongo/MongoUtilsImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.repo.whopper.infrastructure.mongo;
1+
package com.dsm.repo.external.database.mongo;
22

33
import lombok.RequiredArgsConstructor;
44
import org.springframework.data.mongodb.core.BulkOperations;
@@ -11,6 +11,7 @@
1111
@Component
1212
@RequiredArgsConstructor
1313
public class MongoUtilsImpl implements MongoUtils {
14+
1415
private final MongoTemplate mongoTemplate;
1516

1617
@Override
@@ -22,4 +23,5 @@ public <T> Stream<T> find(Query query, Class<T> targetClass) {
2223
public <T> BulkOperations bulkOps(Class<T> targetClass) {
2324
return mongoTemplate.bulkOps(BulkOperations.BulkMode.UNORDERED, targetClass);
2425
}
26+
2527
}

src/main/java/com/repo/whopper/infrastructure/redis/RedisConfig.java renamed to src/main/java/com/dsm/repo/external/database/redis/RedisConfiguration.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.repo.whopper.infrastructure.redis;
1+
package com.dsm.repo.external.database.redis;
22

33
import lombok.RequiredArgsConstructor;
44
import org.springframework.context.annotation.Bean;
@@ -14,11 +14,14 @@
1414
keyspaceNotificationsConfigParameter = "" // Elastic Cache는 CONFIG 명령어를 허용하지 않는 이슈
1515
)
1616
@RequiredArgsConstructor
17-
public class RedisConfig {
17+
class RedisConfiguration {
18+
1819
private final RedisProperties properties;
1920

2021
@Bean
21-
public RedisConnectionFactory redisConnectionFactory() {
22+
RedisConnectionFactory redisConnectionFactory() {
2223
return new LettuceConnectionFactory(properties.host(), properties.port());
2324
}
25+
26+
2427
}

src/main/java/com/repo/whopper/infrastructure/redis/RedisProperties.java renamed to src/main/java/com/dsm/repo/external/database/redis/RedisProperties.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
package com.repo.whopper.infrastructure.redis;
1+
package com.dsm.repo.external.database.redis;
22

33
import org.springframework.boot.context.properties.ConfigurationProperties;
44

55
@ConfigurationProperties(prefix = "redis")
66
public record RedisProperties(
77
String host,
88
int port
9-
) {}
9+
) {
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.dsm.repo.external.exception;
2+
3+
import com.dsm.repo.external.exception.error.ErrorCode;
4+
5+
public class ExternalException extends WhopperException {
6+
public ExternalException(final ErrorCode errorCode) {
7+
super(errorCode);
8+
}
9+
}

src/main/java/com/repo/whopper/common/error/exception/ForbiddenException.java renamed to src/main/java/com/dsm/repo/external/exception/ForbiddenException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
package com.repo.whopper.common.error.exception;
1+
package com.dsm.repo.external.exception;
2+
3+
import com.dsm.repo.external.exception.error.ErrorCode;
24

35
public class ForbiddenException extends WhopperException {
46
public static final WhopperException EXCEPTION = new ForbiddenException();

src/main/java/com/repo/whopper/common/error/GlobalExceptionFilter.java renamed to src/main/java/com/dsm/repo/external/exception/GlobalExceptionFilter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
package com.repo.whopper.common.error;
1+
package com.dsm.repo.external.exception;
22

3-
import com.repo.whopper.common.error.exception.WhopperException;
4-
import com.repo.whopper.common.error.exception.ErrorCode;
3+
import com.dsm.repo.external.exception.WhopperException;
4+
import com.dsm.repo.external.exception.error.ErrorCode;
5+
import com.dsm.repo.external.exception.error.ErrorResponse;
56
import com.fasterxml.jackson.databind.ObjectMapper;
67
import jakarta.servlet.FilterChain;
78
import jakarta.servlet.http.HttpServletRequest;

0 commit comments

Comments
 (0)