Add product classes into domain.
This commit is contained in:
@@ -18,6 +18,12 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
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")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
rootProject.name = "demo"
|
||||
include(":demo-domain")
|
||||
include(":demo-launcher")
|
||||
Reference in New Issue
Block a user