refactor(dto): extract componenthealthdto into separate file
Signed-off-by: Alan Brault <alan.brault@visus.io>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package io.visus.demos.kotlinapi.api.dto
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import io.visus.demos.kotlinapi.domain.model.ComponentHealth
|
||||
|
||||
@Schema(description = "Health status of an individual component")
|
||||
data class ComponentHealthDto(
|
||||
@Schema(description = "Component status", example = "UP")
|
||||
val status: String,
|
||||
@Schema(description = "Optional message with additional details", example = "MongoDB connection is active")
|
||||
val message: String? = null,
|
||||
) {
|
||||
companion object {
|
||||
fun from(componentHealth: ComponentHealth): ComponentHealthDto =
|
||||
ComponentHealthDto(
|
||||
status = componentHealth.status.name,
|
||||
message = componentHealth.message,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -27,19 +27,3 @@ data class HealthResponse(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(description = "Health status of an individual component")
|
||||
data class ComponentHealthDto(
|
||||
@Schema(description = "Component status", example = "UP")
|
||||
val status: String,
|
||||
@Schema(description = "Optional message with additional details", example = "MongoDB connection is active")
|
||||
val message: String? = null,
|
||||
) {
|
||||
companion object {
|
||||
fun from(componentHealth: ComponentHealth): ComponentHealthDto =
|
||||
ComponentHealthDto(
|
||||
status = componentHealth.status.name,
|
||||
message = componentHealth.message,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user