This commit is contained in:
2025-11-25 23:30:38 +02:00
commit 55aaf6cded
8 changed files with 130 additions and 0 deletions

44
.gitignore vendored Normal file
View File

@@ -0,0 +1,44 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
.kotlin
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
.idea

29
build.gradle.kts Normal file
View File

@@ -0,0 +1,29 @@
plugins {
id("java")
alias(libs.plugins.spring.boot)
}
group = "ua.com.dxrkness"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
// spring
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
implementation(libs.spring.boot.starter.web)
implementation(libs.spring.boot.starter.web.test)
implementation(libs.spring.boot.starter.hateoas)
developmentOnly(libs.spring.boot.devtools)
// testing
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform.launcher)
}
tasks.test {
useJUnitPlatform()
}

6
gradle.properties Normal file
View File

@@ -0,0 +1,6 @@
# build cache
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn
org.gradle.configuration-cache.parallel=true

18
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,18 @@
[versions]
junit = "6.0.1"
spring-boot-plugin = "4.0.0"
[plugins]
spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot-plugin" }
[libraries]
# spring
spring-boot-starter-web = { group = "org.springframework.boot", name = "spring-boot-starter-webmvc" }
spring-boot-starter-web-test = { group = "org.springframework.boot", name = "spring-boot-starter-webmvc-test" }
spring-boot-starter-hateoas = { group = "org.springframework.boot", name = "spring-boot-starter-hateoas" }
spring-boot-devtools = { group = "org.springframework.boot", name = "spring-boot-devtools" }
# testing
junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter" }
junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" }

2
settings.gradle.kts Normal file
View File

@@ -0,0 +1,2 @@
rootProject.name = "itroi"
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")

View File

@@ -0,0 +1,11 @@
package ua.com.dxrkness;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class LogisticsApplication {
static void main(String[] args) {
SpringApplication.run(LogisticsApplication.class, args);
}
}

View File

@@ -0,0 +1,17 @@
package ua.com.dxrkness.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Optional;
@RestController
@RequestMapping("/hello")
public class HelloController {
@GetMapping
public String hello(@RequestParam(name = "name", required = false) Optional<String> name) {
return "Hello, %s".formatted(name.orElse("world"));
}
}

View File

@@ -0,0 +1,3 @@
spring:
application:
name: itroi