-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: API 모듈을 추가합니다 #20
Changes from 7 commits
0cb84dc
2778360
7fcfd72
19523c5
95fca5d
8fd929e
64f8289
c81f595
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
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/ | ||
|
||
.DS_Store | ||
.env | ||
*.dylib | ||
Footer | ||
|
||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# AWS User-specific | ||
.idea/**/aws.xml | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
### Java ### | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dependencies { | ||
/** spring starter */ | ||
implementation("org.springframework.boot:spring-boot-starter-webflux") | ||
implementation("org.springframework.boot:spring-boot-starter-actuator") | ||
} | ||
This comment was marked as duplicate.
Sorry, something went wrong. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.few | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication | ||
import org.springframework.boot.runApplication | ||
|
||
@SpringBootApplication | ||
class ApiMain | ||
|
||
fun main(args: Array<String>) { | ||
runApplication<ApiMain>(*args) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 코드조각은 간단한 Spring Boot 애플리케이션을 시작하는 데 사용되며 크게 문제가 없어 보입니다. 다음은 향후 유지보수성 및 확장성을 위해 고려할 수 있는 몇 가지 사항입니다:
버그 위험은 존재하지 않으나, 위의 제안을 고려하는 것이 좋습니다. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") version DependencyVersion.KOTLIN | ||
kotlin("plugin.spring") version DependencyVersion.KOTLIN | ||
kotlin("plugin.allopen") version DependencyVersion.KOTLIN | ||
kotlin("kapt") version DependencyVersion.KOTLIN | ||
|
||
/** spring */ | ||
id("org.springframework.boot") version DependencyVersion.SPRING_BOOT | ||
id("io.spring.dependency-management") version DependencyVersion.SPRING_DEPENDENCY_MANAGEMENT | ||
|
||
/** ktlint */ | ||
id("org.jlleitschuh.gradle.ktlint") version DependencyVersion.KTLINT | ||
|
||
/** docs */ | ||
id("org.asciidoctor.jvm.convert") version DependencyVersion.ASCIIDOCTOR | ||
id("com.epages.restdocs-api-spec") version DependencyVersion.EPAGES_REST_DOCS_API_SPEC | ||
id("org.hidetake.swagger.generator") version DependencyVersion.SWAGGER_GENERATOR | ||
} | ||
|
||
java.sourceCompatibility = JavaVersion.VERSION_17 | ||
|
||
allprojects { | ||
group = "com.few" | ||
|
||
apply(plugin = "org.jetbrains.kotlin.jvm") | ||
apply(plugin = "org.jetbrains.kotlin.plugin.spring") | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions { | ||
freeCompilerArgs = listOf("-Xjsr305=strict") | ||
} | ||
} | ||
|
||
tasks.withType<Wrapper> { | ||
gradleVersion = "8.5" | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
} | ||
|
||
tasks.getByName("bootJar") { | ||
enabled = false | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "org.springframework.boot") | ||
apply(plugin = "io.spring.dependency-management") | ||
apply(plugin = "org.jetbrains.kotlin.plugin.allopen") | ||
apply(plugin = "org.jetbrains.kotlin.kapt") | ||
apply(plugin = "org.jlleitschuh.gradle.ktlint") | ||
apply(plugin = "org.hidetake.swagger.generator") | ||
|
||
/** | ||
* https://kotlinlang.org/docs/reference/compiler-plugins.html#spring-support | ||
* automatically supported annotation | ||
* @Component, @Async, @Transactional, @Cacheable, @SpringBootTest, | ||
* @Configuration, @Controller, @RestController, @Service, @Repository. | ||
* jpa meta-annotations not automatically opened through the default settings of the plugin.spring | ||
*/ | ||
allOpen { | ||
} | ||
|
||
dependencies { | ||
/** spring starter */ | ||
implementation("org.springframework.boot:spring-boot-starter-validation") | ||
kapt("org.springframework.boot:spring-boot-configuration-processor") | ||
|
||
/** kotlin */ | ||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor") | ||
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
|
||
/** logger */ | ||
implementation("net.logstash.logback:logstash-logback-encoder:${DependencyVersion.LOGBACK_ENCODER}") | ||
|
||
/** test **/ | ||
testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
testImplementation("io.mockk:mockk:${DependencyVersion.MOCKK}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 코드 패치는 Gradle 상의 프로젝트 의존성 관련 선언을 보여주고 있습니다. 아래는 코멘트입니다:
참고: 이 코드 리뷰는 변경된 코드에 한정되며, 전체 프로젝트 컨텍스트를 제공하지 않습니다. |
||
|
||
/** kotest */ | ||
testImplementation("io.kotest:kotest-runner-junit5:${DependencyVersion.KOTEST}") | ||
testImplementation("io.kotest:kotest-assertions-core:${DependencyVersion.KOTEST}") | ||
testImplementation("io.kotest.extensions:kotest-extensions-spring:${DependencyVersion.KOTEST_EXTENSION}") | ||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${DependencyVersion.COROUTINE_TEST}") | ||
|
||
/** swagger */ | ||
swaggerUI("org.webjars:swagger-ui:${DependencyVersion.SWAGGER_UI}") | ||
} | ||
|
||
tasks.getByName("bootJar") { | ||
enabled = false | ||
} | ||
|
||
tasks.getByName("jar") { | ||
enabled = true | ||
} | ||
|
||
defaultTasks("bootRun") | ||
} | ||
|
||
/** Build Docker Image */ | ||
val imageName = project.hasProperty("imageName") ?: "api:local" | ||
val releaseVersion = project.findProperty("releaseVersion") | ||
|
||
tasks.create("buildDockerImage") { | ||
dependsOn(":bootJar") | ||
|
||
doLast { | ||
exec { | ||
workingDir(".") | ||
commandLine("docker", "build", "-t", imageName, "--build-arg", "RELEASE_VERSION=$releaseVersion", ".") | ||
} | ||
} | ||
} | ||
This comment was marked as duplicate.
Sorry, something went wrong. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
This comment was marked as duplicate.
Sorry, something went wrong. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
object DependencyVersion { | ||
/** kotlinVersion */ | ||
const val KOTLIN = "1.9.24" | ||
|
||
/** ktlint */ | ||
const val KTLINT = "11.6.1" | ||
|
||
/** springBootVersion */ | ||
const val SPRING_BOOT = "3.2.5" | ||
|
||
/** springDependencyManagementVersion */ | ||
const val SPRING_DEPENDENCY_MANAGEMENT = "1.1.5" | ||
|
||
/** log */ | ||
const val LOGBACK_ENCODER = "7.4" | ||
|
||
/** test */ | ||
const val MOCKK = "1.13.9" | ||
const val KOTEST = "5.8.0" | ||
const val KOTEST_EXTENSION = "1.1.3" | ||
const val COROUTINE_TEST = "1.8.0" | ||
|
||
/** docs */ | ||
const val ASCIIDOCTOR = "3.3.2" | ||
const val EPAGES_REST_DOCS_API_SPEC = "0.16.0" | ||
|
||
/** swagger */ | ||
const val SWAGGER_GENERATOR = "2.18.2" | ||
const val SWAGGER_UI = "4.11.1" | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 코드 패치는 특정 의존성의 버전을 관리하기 위한 Kotlin 코드로 보입니다. 여기에 대한 코드 검토 결과는 다음과 같습니다:
재검토 해야할 사항:
구조적 개선:
버그 리스크: |
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.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
This comment was marked as duplicate.
Sorry, something went wrong. |
This comment was marked as duplicate.
Sorry, something went wrong.