Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8ef71fe
Chore 프로젝트 생성
Unagi-zoso Feb 14, 2025
8ff7742
Refactor application 확장자 변경 및 프로젝트 포매팅 적용
Unagi-zoso Feb 15, 2025
74f9f7f
Chore 개발환경 DB 설정 및 gitignore 추가
Unagi-zoso Feb 15, 2025
663657f
Chore TEST DB 의존성(H2) 추가 및 설정
Unagi-zoso Feb 15, 2025
d73bf62
Feat 기업 코드 및 기간으로 주식 조회하는 쿼리 개발 및 테스트 작성
Unagi-zoso Feb 15, 2025
ece52ec
Feat 기업 코드로 기업 존재 여부 조회하는 쿼리 개발 및 테스트 작성
Unagi-zoso Feb 15, 2025
ec40a7d
Refactor Test Fixture 패키지 이전
Unagi-zoso Feb 15, 2025
8c14ce5
Feat CompanyNotFound 커스텀 예외 작성
Unagi-zoso Feb 15, 2025
d441d1e
Test StockListDto Test Fixture 작성
Unagi-zoso Feb 15, 2025
058dae0
Feat getStockInfo 기능 개발 및 테스트 작성
Unagi-zoso Feb 15, 2025
ecb86e1
Feat ApiKey 관련 커스텀 예외 작성
Unagi-zoso Feb 15, 2025
76c268a
Test contextLoads 테스트에 test 프로파일 활성화
Unagi-zoso Feb 15, 2025
c0cadbd
Feat ApiKeyValidator 개발 및 테스트 작성
Unagi-zoso Feb 15, 2025
8bce90f
Feat ApiResponse 작성
Unagi-zoso Feb 15, 2025
fd89fb0
Feat GlobalExceptionHandler 작성
Unagi-zoso Feb 15, 2025
fc224cb
Refactor StockInfoDto 패키지 이전 (infrastructure -> dto)
Unagi-zoso Feb 15, 2025
0b97d1b
Fix 잘못된 Test Fixture 수정 (createTestStockInfoDtoList)
Unagi-zoso Feb 15, 2025
91cb7d3
Test ApiKeyTestFixture 작성
Unagi-zoso Feb 15, 2025
68069da
Feat 주식 조회 API 개발 및 테스트 코드 작성 (StockController)
Unagi-zoso Feb 15, 2025
85213a2
Chore AOP 의존성 추가 및 Config 빈 생성
Unagi-zoso Feb 15, 2025
eb9149f
Feat Json, Xml 변환 기능 구현 및 테스트 작성
Unagi-zoso Feb 15, 2025
29d7cfe
Feat JsonXmlResponseAspect 적용
Unagi-zoso Feb 15, 2025
d9aa216
Chore Validation 의존성 추가
Unagi-zoso Feb 15, 2025
ba125d8
Feat 전역 예외 핸들러에 유효성 관련 예외 추가
Unagi-zoso Feb 15, 2025
46e8097
Feat StockInfoRequest dto 작성 및 유효성 어노테이션 추가, 테스트 작성
Unagi-zoso Feb 15, 2025
de09ca0
Refactor test..util 패키지 이름 변경 (util -> support)
Unagi-zoso Feb 16, 2025
b67bb4c
Feat 전역 에러 반환 포맷에 XML 추가
Unagi-zoso Feb 16, 2025
45527ca
Feat 예외처리필터 구현 및 테스트 작성
Unagi-zoso Feb 16, 2025
30baa88
Feat Api 의 상수값 일부를 파일로 관리
Unagi-zoso Feb 16, 2025
612d2a6
Feat ApiKeyAuthFilter 구현 및 테스트 작성
Unagi-zoso Feb 16, 2025
9337ab5
Refactor 기존 API 인가 로직 제거
Unagi-zoso Feb 16, 2025
6c49478
Refactor Intellij 포매팅 일괄 적용
Unagi-zoso Feb 16, 2025
f3fa913
Feat RateLimiter 구현 및 테스트 작성
Unagi-zoso Feb 16, 2025
662fe91
Feat RateLimiterFilter 구현 및 테스트 작성
Unagi-zoso Feb 16, 2025
f248357
Chore 유효하지 않은 DB 설정 수정
Unagi-zoso Feb 16, 2025
05cb0f4
Chore logging 의존성 추가 및 설정
Unagi-zoso Feb 16, 2025
7ccca1d
Feat 예외 핸들러에 로깅 추가
Unagi-zoso Feb 16, 2025
7fa2006
Feat RateLimit 초과 커스텀 예외 작성 (RateLimitExceededException)
Unagi-zoso Feb 16, 2025
ac648c3
Refactor Rate Limit 예외 응답 로직을 예외핸들링필터로 위임
Unagi-zoso Feb 16, 2025
9bb74c5
Chore 배포 관련 build.gradle 수정
Unagi-zoso Feb 16, 2025
66d3286
Chore Dockerfile 및 배포 관련 파일 작성
Unagi-zoso Feb 16, 2025
7d401a1
Feat 존재하지 않는 자원 접근 시 404 반환하도록 핸들링 추가
Unagi-zoso Feb 16, 2025
8354999
Comment 특정 응답 값을 설계한 이유 코멘트
Unagi-zoso Feb 16, 2025
4d867f9
Refactor 사용되지 않는 의존성 제거
Unagi-zoso Feb 16, 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
5 changes: 5 additions & 0 deletions ktb-be-dev-assignment/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
target/
*.war
*.log
node_modules/
.env
3 changes: 3 additions & 0 deletions ktb-be-dev-assignment/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary
42 changes: 42 additions & 0 deletions ktb-be-dev-assignment/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

.env

### logs ###
logs/
15 changes: 15 additions & 0 deletions ktb-be-dev-assignment/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM eclipse-temurin:17-jdk-alpine

WORKDIR /app

COPY build/libs/app.jar app.jar

RUN chmod +x app.jar

# 5️⃣ 환경 변수 파일을 지원하기 위해 envsubst 설치
RUN apk add --no-cache bash gettext

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
57 changes: 57 additions & 0 deletions ktb-be-dev-assignment/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.2'
id 'io.spring.dependency-management' version '1.1.7'
}

group = 'org.ktb'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
mavenCentral()
}

dependencies {
// Springboot starter
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-logging'

// etc
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.18.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2' // LocalDateTime parsing 을 위해 추가

// DB
runtimeOnly 'com.mysql:mysql-connector-j'

// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'com.h2database:h2:2.3.232'
}

jar {
enabled = false // 기본 JAR 빌드를 비활성화하여 실행 가능 JAR를 생성
}

bootJar {
manifest {
attributes 'Main-Class': 'org.springframework.boot.loader.launch.JarLauncher'
}

archiveBaseName.set('app') // JAR 파일 이름을 'app'으로 설정
archiveVersion.set('') // 버전 정보 제거
archiveClassifier.set('') // 추가적인 접미사 제거
}

tasks.named('test') {
useJUnitPlatform()
}
16 changes: 16 additions & 0 deletions ktb-be-dev-assignment/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

echo "🔥 [INFO] EntryPoint Script 시작됨" # stdout에 로그 남기기

# app.jar 파일 존재 여부 확인
if [ -f "/app/app.jar" ]; then
echo "✅ [INFO] app.jar 파일이 존재합니다."
else
echo "❌ [ERROR] app.jar 파일을 찾을 수 없습니다! 애플리케이션을 실행할 수 없습니다." >&2
exit 1
fi

# Spring Boot 애플리케이션 실행
echo "🚀 [INFO] 애플리케이션 실행 시작..."
exec java -jar /app/app.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading