Add product classes into domain.

This commit is contained in:
Florian THIERRY
2025-04-14 13:52:20 +02:00
parent b5b896cb47
commit 2ca85aab88
7 changed files with 44 additions and 5 deletions

View File

@@ -18,6 +18,12 @@ repositories {
mavenCentral() mavenCentral()
} }
subprojects {
repositories {
mavenCentral()
}
}
dependencies { dependencies {
implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") implementation("com.fasterxml.jackson.module:jackson-module-kotlin")

View File

@@ -0,0 +1,8 @@
plugins {
kotlin("jvm")
id("java")
}
dependencies {
implementation(kotlin("stdlib"))
}

View File

@@ -0,0 +1,9 @@
package com.example.demo.domain.product.model
import java.util.UUID
data class Product(
val id: UUID,
val name: String,
val type: ProductType
)

View File

@@ -0,0 +1,7 @@
package com.example.demo.domain.product.model
enum class ProductType {
SOLID,
LIQUID,
GAS
}

View File

@@ -0,0 +1,12 @@
package com.example.demo.domain.product.port
import com.example.demo.domain.product.model.Product
import java.util.UUID
interface ProductPort {
fun getById(id: UUID): Product?
fun getAll(): List<Product>
fun save(product: Product)
}

View File

@@ -5,10 +5,6 @@ plugins {
id("java") id("java")
} }
repositories {
mavenCentral()
}
dependencies { dependencies {
implementation(kotlin("stdlib")) implementation(kotlin("stdlib"))
implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-web")

View File

@@ -1,2 +1,3 @@
rootProject.name = "demo" rootProject.name = "demo"
include(":demo-domain")
include(":demo-launcher") include(":demo-launcher")