-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add swagger & ktlinter * /api/echo/{input} echo server
- Loading branch information
Showing
9 changed files
with
86 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,46 @@ | ||
plugins { | ||
kotlin("jvm") version "1.9.25" | ||
kotlin("plugin.spring") version "1.9.25" | ||
id("org.springframework.boot") version "3.4.1" | ||
id("io.spring.dependency-management") version "1.1.7" | ||
kotlin("jvm") version "1.9.25" | ||
kotlin("plugin.spring") version "1.9.25" | ||
id("org.springframework.boot") version "3.4.1" | ||
id("io.spring.dependency-management") version "1.1.7" | ||
id("org.jlleitschuh.gradle.ktlint") version "12.1.2" | ||
} | ||
|
||
group = "com.ToyProject" | ||
version = "0.0.1-SNAPSHOT" | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("org.springframework.boot:spring-boot-starter-web") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
developmentOnly("org.springframework.boot:spring-boot-devtools") | ||
testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") | ||
testRuntimeOnly("org.junit.platform:junit-platform-launcher") | ||
implementation("org.springframework.boot:spring-boot-starter-web") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
developmentOnly("org.springframework.boot:spring-boot-devtools") | ||
testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") | ||
testRuntimeOnly("org.junit.platform:junit-platform-launcher") | ||
|
||
implementation("org.hibernate.validator:hibernate-validator:8.0.0.Final") | ||
testImplementation("org.glassfish:jakarta.el:5.0.0-M1") | ||
|
||
implementation("org.springframework.boot:spring-boot-starter") | ||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0") | ||
} | ||
|
||
kotlin { | ||
compilerOptions { | ||
freeCompilerArgs.addAll("-Xjsr305=strict") | ||
} | ||
compilerOptions { | ||
freeCompilerArgs.addAll("-Xjsr305=strict") | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
src/main/kotlin/com/ToyProject/__5_team1_server/controller/TestController.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/kotlin/com/waffletoy/team1server/echoserver/controller/EchoController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.waffletoy.team1server.echoserver.controller | ||
|
||
import com.waffletoy.team1server.echoserver.service.EchoService | ||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.Parameter | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.RequestParam | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@RestController | ||
class EchoController( | ||
private val echoService: EchoService, | ||
) { | ||
@Operation( | ||
summary = "Echo endpoint", | ||
description = "문자열을 받아 대문자로 변환합니다.", | ||
) | ||
@GetMapping("/api/echo/{input}") | ||
fun echo( | ||
@Parameter(description = "대문자로 변환할 문자열") | ||
@PathVariable(required = false) input: String?, | ||
): String { | ||
val value = input ?: "no input" | ||
return echoService.convertToUpperCase(value) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/kotlin/com/waffletoy/team1server/echoserver/service/EchoService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.waffletoy.team1server.echoserver.service | ||
|
||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class EchoService { | ||
fun convertToUpperCase(input: String): String { | ||
return input.uppercase() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
spring: | ||
application: | ||
name: team1server | ||
|
||
springdoc: | ||
swagger-ui: | ||
enabled: ${SPRING_DOC_SWAGGER_UI_ENABLED:true} | ||
path: ${SPRING_DOC_SWAGGER_UI_PATH:/swagger-ui} | ||
api-docs: | ||
enabled: ${SPRING_DOC_API_DOCS_ENABLED:true} | ||
path: ${SPRING_DOC_API_DOCS_PATH:/v3/api-docs} |
10 changes: 4 additions & 6 deletions
10
...ject/__5_team1_server/ApplicationTests.kt → ...waffletoy/team1server/ApplicationTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
package com.ToyProject.__5_team1_server | ||
package com.waffletoy.team1server | ||
|
||
import org.junit.jupiter.api.Test | ||
import org.springframework.boot.test.context.SpringBootTest | ||
|
||
@SpringBootTest | ||
class ApplicationTests { | ||
|
||
@Test | ||
fun contextLoads() { | ||
} | ||
|
||
@Test | ||
fun contextLoads() { | ||
} | ||
} |