Add product classes into domain.
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
8
demo-domain/build.gradle.kts
Normal file
8
demo-domain/build.gradle.kts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm")
|
||||||
|
id("java")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("stdlib"))
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
)
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.example.demo.domain.product.model
|
||||||
|
|
||||||
|
enum class ProductType {
|
||||||
|
SOLID,
|
||||||
|
LIQUID,
|
||||||
|
GAS
|
||||||
|
}
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
@@ -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")
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
rootProject.name = "demo"
|
rootProject.name = "demo"
|
||||||
include(":demo-launcher")
|
include(":demo-domain")
|
||||||
|
include(":demo-launcher")
|
||||||
|
|||||||
Reference in New Issue
Block a user