Skip to content

Commit 6929bea

Browse files
Merge pull request #30 from EntryDSM/feature/28-school-info
feature/28-school-info
2 parents f4a0069 + a70acea commit 6929bea

45 files changed

Lines changed: 1266 additions & 357 deletions

Some content is hidden

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

buildSrc/src/main/kotlin/Dependencies.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ object Dependencies {
88
const val SPRING_BOOT_STARTER_WEB = "org.springframework.boot:spring-boot-starter-web"
99
const val SPRING_BOOT_STARTER_TEST = "org.springframework.boot:spring-boot-starter-test"
1010
const val SPRING_BOOT_STARTER_ACTUATOR = "org.springframework.boot:spring-boot-starter-actuator"
11+
const val SPRING_CONTEXT = "org.springframework:spring-context"
1112

1213
//jexl
1314
const val APACHE_COMMONS_JEXL = "org.apache.commons:commons-jexl3:${DependencyVersions.APACHE_COMMONS_JEXL_VERSION}"
@@ -35,6 +36,12 @@ object Dependencies {
3536
//commons io
3637
const val COMMONS_IO = "commons-io:commons-io:${DependencyVersions.COMMONS_IO}"
3738

39+
// Feign Client
40+
const val OPEN_FEIGN = "org.springframework.cloud:spring-cloud-starter-openfeign:${DependencyVersions.OPEN_FEIGN_VERSION}"
41+
42+
// Spring Cloud BOM
43+
const val SPRING_CLOUD = "org.springframework.cloud:spring-cloud-dependencies:${DependencyVersions.SPRING_CLOUD_VERSION}"
44+
3845
// WebFlux
3946
const val WEB_FLUX = "org.springframework.boot:spring-boot-starter-webflux"
4047

@@ -82,5 +89,13 @@ object Dependencies {
8289
const val SPRING_BOOT_STARTER_DATA_JPA = "org.springframework.boot:spring-boot-starter-data-jpa"
8390

8491
// transaction
85-
const val SPRING_TRANSACTION = "org.springframework:spring-tx:${DependencyVersions.SPRING_TRANSACTION}"
86-
}
92+
const val SPRING_TRANSACTION = "org.springframework:spring-tx"
93+
94+
//spring cache
95+
// Redis (캐시)
96+
const val REDIS = "org.springframework.boot:spring-boot-starter-data-redis"
97+
98+
// Cache (스프링 캐시)
99+
const val SPRING_CACHE = "org.springframework.boot:spring-boot-starter-cache"
100+
101+
}
Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,47 @@
11
object DependencyVersions {
22
// JEXL
33
const val APACHE_COMMONS_JEXL_VERSION = "3.5.0"
4-
4+
55
// Kotlinx Serialization
66
const val KOTLINX_SERIALIZATION_VERSION = "1.6.3"
7-
7+
88
// Kotlinx Coroutines
99
const val KOTLINX_COROUTINES_VERSION = "1.8.1"
1010

11+
// PDF
1112
const val PDF_ITEXT = "7.2.0"
1213
const val PDF_HTML = "3.0.3"
14+
15+
// Apache POI
1316
const val POI_VERSION = "5.2.3"
17+
18+
// Commons IO
1419
const val COMMONS_IO = "2.11.0"
1520

16-
const val GRPC = "1.61.1"
17-
const val GRPC_KOTLIN = "1.4.1"
18-
const val PROTOBUF = "3.25.3"
19-
const val GRPC_CLIENT = "2.15.0.RELEASE"
20-
const val GOOGLE_PROTOBUF = "3.25.3"
21+
// Spring Cloud (Feign 포함)
22+
const val SPRING_CLOUD_VERSION = "2024.0.0"
23+
const val OPEN_FEIGN_VERSION = "3.1.4"
24+
25+
// gRPC
26+
const val GRPC = "1.58.0" // 1.61.1에서 변경
27+
const val GRPC_KOTLIN = "1.4.0" // 1.4.1에서 변경
28+
const val GRPC_CLIENT = "2.15.0.RELEASE" // 유지
29+
const val PROTOBUF = "3.24.0" // 3.25.3에서 변경
30+
const val GOOGLE_PROTOBUF = "3.24.0" // 3.25.3에서 변경
2131

32+
// Coroutines (main 쪽 버전, KOTLINX_COROUTINES_VERSION 과 구분됨)
2233
const val COROUTINES = "1.8.0"
34+
35+
// MapStruct
2336
const val MAPSTRUCT = "1.6.0"
2437

38+
// QueryDSL
2539
const val QUERYDSL = "5.0.0"
40+
41+
// Jakarta
2642
const val JAKARTA_PERSISTENCE = "3.1.0"
2743
const val JAKARTA_ANNOTATION = "2.1.1"
28-
const val CAFFEINE = "3.1.8"
2944

30-
const val SPRING_TRANSACTION = "5.3.22"
31-
}
45+
// Caffeine
46+
const val CAFFEINE = "3.1.8"
47+
}

buildSrc/src/main/kotlin/Plugins.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ object Plugins {
88
const val SPRING_DEPENDENCY_MANAGEMENT = "io.spring.dependency-management"
99
const val KTLINT = "org.jlleitschuh.gradle.ktlint"
1010
const val CASPER_CONVENTION = "casper.documentation-convention"
11+
12+
// feature/28-school-info
13+
const val KOTLIN_ALL_OPEN = "org.jetbrains.kotlin.plugin.spring"
14+
15+
// main 브랜치
1116
const val KAPT = "kapt"
1217
const val PROTOBUF = "com.google.protobuf"
1318
const val ALL_OPEN = "plugin.allopen"
14-
}
19+
}

casper-application-domain/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
plugins {
22
kotlin(Plugins.KOTLIN_JVM) version PluginVersions.KOTLIN_VERSION
33
kotlin(Plugins.KOTLIN_SERIALIZATION) version PluginVersions.KOTLIN_VERSION
4+
id(Plugins.KOTLIN_ALL_OPEN) version PluginVersions.KOTLIN_VERSION
45
}
56

67
version = Projects.APPLICATION_DOMAIN_VERSION
78

89
dependencies {
10+
911
implementation(Dependencies.KOTLINX_SERIALIZATION_JSON)
1012
implementation(Dependencies.KOTLINX_COROUTINES_CORE)
1113

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package hs.kr.entrydsm.domain.school.aggregate
2+
3+
import hs.kr.entrydsm.domain.school.exception.SchoolException
4+
5+
/**
6+
* 학교 정보를 담는 데이터 클래스 입니다.
7+
*
8+
* @property code 학교 코드
9+
* @property name 학교 이름
10+
* @property tel 학교 전화번호
11+
* @property type 학교 타입
12+
* @property address 학교 주소
13+
* @property regionName 지역 이름
14+
*/
15+
data class School(
16+
val code: String,
17+
val name: String,
18+
val tel: String,
19+
val type: String,
20+
val address: String,
21+
val regionName: String
22+
) {
23+
init {
24+
check(type == "중학교") {
25+
throw SchoolException.InvalidSchoolTypeException(type)
26+
}
27+
}
28+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package hs.kr.entrydsm.domain.school.dto
2+
3+
/**
4+
* 학교 검색 결과를 담는 데이터 클래스 입니다.
5+
*
6+
* @property content 학교 검색 결과 리스트
7+
*/
8+
data class QuerySchoolResponse(
9+
val content: List<SchoolResponse>
10+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package hs.kr.entrydsm.domain.school.dto
2+
3+
/**
4+
* 학교 정보를 담는 데이터 클래스 입니다.
5+
*
6+
* @property code 학교 코드
7+
* @property name 학교 이름
8+
* @property information 학교 정보
9+
* @property address 학교 주소
10+
*/
11+
data class SchoolResponse(
12+
val code: String,
13+
val name: String,
14+
val information: String,
15+
val address: String
16+
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package hs.kr.entrydsm.domain.school.exception
2+
3+
import hs.kr.entrydsm.global.exception.DomainException
4+
import hs.kr.entrydsm.global.exception.ErrorCode
5+
6+
/**
7+
* 학교 관련 최상위 예외 클래스 입니다.
8+
*/
9+
sealed class SchoolException(
10+
errorCode: ErrorCode, // override 제거
11+
message: String
12+
) : DomainException(errorCode, message) {
13+
14+
15+
/**
16+
* 유효하지 않은 학교 타입일 경우 발생하는 예외입니다.
17+
*/
18+
class InvalidSchoolTypeException(schoolType: String) : SchoolException(
19+
errorCode = ErrorCode.SCHOOL_INVALID_TYPE,
20+
message = "Invalid school type: $schoolType"
21+
)
22+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package hs.kr.entrydsm.domain.school.interfaces
2+
3+
import hs.kr.entrydsm.domain.school.aggregate.School
4+
5+
/**
6+
* 학교 정보를 조회하는 Contract 입니다.
7+
*/
8+
interface QuerySchoolContract {
9+
/**
10+
* 학교 이름으로 학교 리스트를 조회합니다.
11+
*
12+
* @param schoolName 학교 이름
13+
* @return 학교 리스트
14+
*/
15+
fun querySchoolListBySchoolName(schoolName: String): List<School>
16+
17+
/**
18+
* 학교 코드로 학교를 조회합니다.
19+
*
20+
* @param schoolCode 학교 코드
21+
* @return 학교 정보
22+
*/
23+
fun querySchoolBySchoolCode(schoolCode: String): School?
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package hs.kr.entrydsm.domain.school.interfaces
2+
3+
import hs.kr.entrydsm.domain.school.dto.QuerySchoolResponse
4+
5+
/**
6+
* 학교 정보를 조회하는 UseCase Contract 입니다.
7+
*/
8+
interface QuerySchoolUseCaseContract {
9+
/**
10+
* 학교 이름으로 학교를 조회합니다.
11+
*
12+
* @param name 학교 이름
13+
* @return 학교 검색 결과
14+
*/
15+
fun querySchool(name: String): QuerySchoolResponse
16+
}

0 commit comments

Comments
 (0)