Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
efb0ef5
refactor ( #28 ) : ktlint
qkrwndnjs1075 Aug 26, 2025
a28cca4
feat ( #28 ) : school aggregate 추가
qkrwndnjs1075 Aug 27, 2025
e8dd3c0
feat ( #28 ) : exception 추가
qkrwndnjs1075 Aug 27, 2025
cbe8dd3
feat ( #28 ) : Contract 추가
qkrwndnjs1075 Aug 27, 2025
197882e
feat ( #28 ) : web dto 추가
qkrwndnjs1075 Aug 27, 2025
1bb0d04
feat ( #28 ) : 도메인 dto 추가
qkrwndnjs1075 Aug 27, 2025
3dfbb19
feat ( #28 ) : persistenceAdapter 추가
qkrwndnjs1075 Aug 27, 2025
05b4f2c
feat ( #28 ) : redis Repository 추가
qkrwndnjs1075 Aug 27, 2025
0e5f685
feat ( #28 ) : UseCase 추가
qkrwndnjs1075 Aug 27, 2025
61cc9c2
feat ( #28 ) : 커스텀 어노테이션 추가
qkrwndnjs1075 Aug 27, 2025
b23f286
feat ( #28 ) : feign client 추가
qkrwndnjs1075 Aug 27, 2025
e7d0c7c
feat ( #28 ) : feign dto 추가
qkrwndnjs1075 Aug 27, 2025
9c51b2b
feat ( #28 ) : webAdapter 추가 + 테스트 컨트롤러
qkrwndnjs1075 Aug 27, 2025
4eab313
feat ( #28 ) : redisEntity 추가
qkrwndnjs1075 Aug 27, 2025
6300d13
feat ( #28 ) : feign Config 추가
qkrwndnjs1075 Aug 27, 2025
0582fd6
feat ( #28 ) : 에러 코드 추가
qkrwndnjs1075 Aug 27, 2025
5e0bb3c
feat ( #28 ) : gradle 의존성 추가
qkrwndnjs1075 Aug 27, 2025
98b6c73
feat ( #28 ) : feign 에러 decoder 추가
qkrwndnjs1075 Aug 27, 2025
5b5e4b7
refactor ( #28 ) : solve conflict
qkrwndnjs1075 Aug 27, 2025
6492630
Merge remote-tracking branch 'origin/main' into feature/28-school-info
qkrwndnjs1075 Aug 27, 2025
ec8108e
feat ( #28 ) : kdoc 추가
qkrwndnjs1075 Aug 27, 2025
a70acea
fix ( #28 ) : conflict 해결
qkrwndnjs1075 Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ object Dependencies {
const val SPRING_BOOT_STARTER_WEB = "org.springframework.boot:spring-boot-starter-web"
const val SPRING_BOOT_STARTER_TEST = "org.springframework.boot:spring-boot-starter-test"
const val SPRING_BOOT_STARTER_ACTUATOR = "org.springframework.boot:spring-boot-starter-actuator"
const val SPRING_CONTEXT = "org.springframework:spring-context"

//jexl
const val APACHE_COMMONS_JEXL = "org.apache.commons:commons-jexl3:${DependencyVersions.APACHE_COMMONS_JEXL_VERSION}"
Expand Down Expand Up @@ -35,6 +36,12 @@ object Dependencies {
//commons io
const val COMMONS_IO = "commons-io:commons-io:${DependencyVersions.COMMONS_IO}"

// Feign Client
const val OPEN_FEIGN = "org.springframework.cloud:spring-cloud-starter-openfeign:${DependencyVersions.OPEN_FEIGN_VERSION}"

// Spring Cloud BOM
const val SPRING_CLOUD = "org.springframework.cloud:spring-cloud-dependencies:${DependencyVersions.SPRING_CLOUD_VERSION}"

// WebFlux
const val WEB_FLUX = "org.springframework.boot:spring-boot-starter-webflux"

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

// transaction
const val SPRING_TRANSACTION = "org.springframework:spring-tx:${DependencyVersions.SPRING_TRANSACTION}"
}
const val SPRING_TRANSACTION = "org.springframework:spring-tx"

//spring cache
// Redis (캐시)
const val REDIS = "org.springframework.boot:spring-boot-starter-data-redis"

// Cache (스프링 캐시)
const val SPRING_CACHE = "org.springframework.boot:spring-boot-starter-cache"

}
36 changes: 26 additions & 10 deletions buildSrc/src/main/kotlin/DependencyVersions.kt
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
object DependencyVersions {
// JEXL
const val APACHE_COMMONS_JEXL_VERSION = "3.5.0"

// Kotlinx Serialization
const val KOTLINX_SERIALIZATION_VERSION = "1.6.3"

// Kotlinx Coroutines
const val KOTLINX_COROUTINES_VERSION = "1.8.1"

// PDF
const val PDF_ITEXT = "7.2.0"
const val PDF_HTML = "3.0.3"

// Apache POI
const val POI_VERSION = "5.2.3"

// Commons IO
const val COMMONS_IO = "2.11.0"

const val GRPC = "1.61.1"
const val GRPC_KOTLIN = "1.4.1"
const val PROTOBUF = "3.25.3"
const val GRPC_CLIENT = "2.15.0.RELEASE"
const val GOOGLE_PROTOBUF = "3.25.3"
// Spring Cloud (Feign 포함)
const val SPRING_CLOUD_VERSION = "2024.0.0"
const val OPEN_FEIGN_VERSION = "3.1.4"

// gRPC
const val GRPC = "1.58.0" // 1.61.1에서 변경
const val GRPC_KOTLIN = "1.4.0" // 1.4.1에서 변경
const val GRPC_CLIENT = "2.15.0.RELEASE" // 유지
const val PROTOBUF = "3.24.0" // 3.25.3에서 변경
const val GOOGLE_PROTOBUF = "3.24.0" // 3.25.3에서 변경

// Coroutines (main 쪽 버전, KOTLINX_COROUTINES_VERSION 과 구분됨)
const val COROUTINES = "1.8.0"

// MapStruct
const val MAPSTRUCT = "1.6.0"

// QueryDSL
const val QUERYDSL = "5.0.0"

// Jakarta
const val JAKARTA_PERSISTENCE = "3.1.0"
const val JAKARTA_ANNOTATION = "2.1.1"
const val CAFFEINE = "3.1.8"

const val SPRING_TRANSACTION = "5.3.22"
}
// Caffeine
const val CAFFEINE = "3.1.8"
}
7 changes: 6 additions & 1 deletion buildSrc/src/main/kotlin/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ object Plugins {
const val SPRING_DEPENDENCY_MANAGEMENT = "io.spring.dependency-management"
const val KTLINT = "org.jlleitschuh.gradle.ktlint"
const val CASPER_CONVENTION = "casper.documentation-convention"

// feature/28-school-info
const val KOTLIN_ALL_OPEN = "org.jetbrains.kotlin.plugin.spring"

// main 브랜치
const val KAPT = "kapt"
const val PROTOBUF = "com.google.protobuf"
const val ALL_OPEN = "plugin.allopen"
}
}
2 changes: 2 additions & 0 deletions casper-application-domain/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
plugins {
kotlin(Plugins.KOTLIN_JVM) version PluginVersions.KOTLIN_VERSION
kotlin(Plugins.KOTLIN_SERIALIZATION) version PluginVersions.KOTLIN_VERSION
id(Plugins.KOTLIN_ALL_OPEN) version PluginVersions.KOTLIN_VERSION
}

version = Projects.APPLICATION_DOMAIN_VERSION

dependencies {

implementation(Dependencies.KOTLINX_SERIALIZATION_JSON)
implementation(Dependencies.KOTLINX_COROUTINES_CORE)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package hs.kr.entrydsm.domain.school.aggregate

import hs.kr.entrydsm.domain.school.exception.SchoolException

/**
* 학교 정보를 담는 데이터 클래스 입니다.
*
* @property code 학교 코드
* @property name 학교 이름
* @property tel 학교 전화번호
* @property type 학교 타입
* @property address 학교 주소
* @property regionName 지역 이름
*/
data class School(
val code: String,
val name: String,
val tel: String,
val type: String,
val address: String,
val regionName: String
) {
init {
check(type == "중학교") {
throw SchoolException.InvalidSchoolTypeException(type)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package hs.kr.entrydsm.domain.school.dto

/**
* 학교 검색 결과를 담는 데이터 클래스 입니다.
*
* @property content 학교 검색 결과 리스트
*/
data class QuerySchoolResponse(
val content: List<SchoolResponse>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package hs.kr.entrydsm.domain.school.dto

/**
* 학교 정보를 담는 데이터 클래스 입니다.
*
* @property code 학교 코드
* @property name 학교 이름
* @property information 학교 정보
* @property address 학교 주소
*/
data class SchoolResponse(
val code: String,
val name: String,
val information: String,
val address: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package hs.kr.entrydsm.domain.school.exception

import hs.kr.entrydsm.global.exception.DomainException
import hs.kr.entrydsm.global.exception.ErrorCode

/**
* 학교 관련 최상위 예외 클래스 입니다.
*/
sealed class SchoolException(
errorCode: ErrorCode, // override 제거
message: String
) : DomainException(errorCode, message) {


/**
* 유효하지 않은 학교 타입일 경우 발생하는 예외입니다.
*/
class InvalidSchoolTypeException(schoolType: String) : SchoolException(
errorCode = ErrorCode.SCHOOL_INVALID_TYPE,
message = "Invalid school type: $schoolType"
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package hs.kr.entrydsm.domain.school.interfaces

import hs.kr.entrydsm.domain.school.aggregate.School

/**
* 학교 정보를 조회하는 Contract 입니다.
*/
interface QuerySchoolContract {
/**
* 학교 이름으로 학교 리스트를 조회합니다.
*
* @param schoolName 학교 이름
* @return 학교 리스트
*/
fun querySchoolListBySchoolName(schoolName: String): List<School>

/**
* 학교 코드로 학교를 조회합니다.
*
* @param schoolCode 학교 코드
* @return 학교 정보
*/
fun querySchoolBySchoolCode(schoolCode: String): School?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package hs.kr.entrydsm.domain.school.interfaces

import hs.kr.entrydsm.domain.school.dto.QuerySchoolResponse

/**
* 학교 정보를 조회하는 UseCase Contract 입니다.
*/
interface QuerySchoolUseCaseContract {
/**
* 학교 이름으로 학교를 조회합니다.
*
* @param name 학교 이름
* @return 학교 검색 결과
*/
fun querySchool(name: String): QuerySchoolResponse
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package hs.kr.entrydsm.domain.school.interfaces

/**
* School 도메인의 Persistence를 관리하는 Contract 입니다.
*/
interface SchoolContract : QuerySchoolContract {
}
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,14 @@ enum class ErrorCode(val code: String, val description: String) {
ENTITY_CONTRACT_NOT_IMPLEMENTED("ANT002", "EntityCont,ract 미구현"),
INVALID_AGGREGATE_ROOT("ANT003", "유효하지 않은 Aggregate Root"),

// ExamCode 오류 (EXP)
FAILED_GEOCODE_CONVERSION("EXA001", "주소를 변환할 수 없습니다.");
// School 도메인 오류 (SCH)
SCHOOL_INVALID_TYPE("SCH001", "유효하지 않은 학교 유형입니다"),

//feign error
FEIGN_SERVER_ERROR("FGN001", "외부 API 서버 오류가 발생했습니다"),

// ExamCode 오류 (EXA)
FAILED_GEOCODE_CONVERSION("EXA001", "주소를 변환할 수 없습니다");

/**
* 오류 코드의 도메인 접두사를 반환합니다.
Expand Down
59 changes: 37 additions & 22 deletions casper-application-infrastructure/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,80 @@ repositories {
mavenCentral()
}

dependencyManagement {
imports {
mavenBom(Dependencies.SPRING_CLOUD)
}
}

dependencies {
implementation(project(":casper-application-domain"))

// Spring Boot
implementation(Dependencies.SPRING_BOOT_STARTER)
implementation(Dependencies.SPRING_BOOT_STARTER_WEB)
implementation(Dependencies.SPRING_BOOT_STARTER_TEST)
implementation(Dependencies.SPRING_BOOT_STARTER_ACTUATOR)
implementation(Dependencies.SPRING_BOOT_STARTER_TEST)
implementation(Dependencies.SPRING_BOOT_STARTER_DATA_JPA)
implementation(Dependencies.SPRING_CACHE)

implementation(Dependencies.APACHE_COMMONS_JEXL)
//redis
implementation(Dependencies.REDIS)

// Kotlin
implementation(Dependencies.KOTLIN_REFLECT)
testImplementation(Dependencies.KOTLIN_TEST)

// itext
// Utilities
implementation(Dependencies.APACHE_COMMONS_JEXL)
implementation(Dependencies.COMMONS_IO)

// PDF / Template
implementation(Dependencies.PDF_HTML)
implementation (Dependencies.THYMELEAF)
implementation(Dependencies.THYMELEAF)

//read-file
implementation(Dependencies.COMMONS_IO)
// Excel
implementation(Dependencies.POI)
implementation(Dependencies.POI_OOXML)

// grpc
// Feign
implementation(Dependencies.OPEN_FEIGN)

// Jackson
implementation(Dependencies.JACKSON_MODULE_KOTLIN)

// gRPC
implementation(Dependencies.GRPC_NETTY_SHADED)
implementation(Dependencies.GRPC_PROTOBUF)
implementation(Dependencies.GRPC_STUB)
implementation(Dependencies.GRPC_KOTLIN_STUB)
implementation(Dependencies.PROTOBUF_KOTLIN)
testImplementation(Dependencies.GRPC_TESTING)
implementation(Dependencies.GRPC_CLIENT)
testImplementation(Dependencies.GRPC_TESTING)
implementation(Dependencies.GOOGLE_PROTOBUF)

// coroutines
// Coroutines
implementation(Dependencies.COROUTINES)
implementation(Dependencies.COROUTINES_REACTOR)

// mapstruct
// MapStruct
implementation(Dependencies.MAPSTRUCT)
kapt(Dependencies.MAPSTRUCT_PROCESSOR)

// QueryDSL
implementation(Dependencies.QUERYDSL_JPA)
kapt(Dependencies.QUERYDSL_APT)
kapt(Dependencies.JAKARTA_PERSISTENCE_API)
kapt(Dependencies.JAKARTA_ANNOTATION_API)

// web flux
// WebFlux
implementation(Dependencies.WEB_FLUX)

// mysql
runtimeOnly(Dependencies.MYSQL_CONNECTOR)

// cache / jackson / reactor
// Cache
implementation(Dependencies.CAFFEINE)
implementation(Dependencies.JACKSON_MODULE_KOTLIN)
implementation(Dependencies.COROUTINES_REACTOR)
runtimeOnly(Dependencies.REACTOR_NETTY)

implementation(Dependencies.SPRING_TRANSACTION)

implementation(project(":casper-application-domain"))
// MySQL
runtimeOnly(Dependencies.MYSQL_CONNECTOR)
}

protobuf {
Expand Down Expand Up @@ -127,7 +143,6 @@ kapt {
ktlint {
ignoreFailures.set(true)
filter {
// 넓게 막습니다: build 전부 + generated 전부
exclude("**/build/**")
exclude("**/generated/**")
}
Expand Down
Loading