add nodes endpoint
- add NodesController - add NodesEndpoint - add NodesControllerTest - add NodesController - add nodes.http - add NodeEntity toNodesResponse in Mapping.kt - add getNodes to NodeService - add findAll to NodeRepository
This commit is contained in:
@@ -12,6 +12,7 @@ import ltd.hlaeja.library.deviceRegistry.Device
|
||||
import ltd.hlaeja.library.deviceRegistry.Devices
|
||||
import ltd.hlaeja.library.deviceRegistry.Identity
|
||||
import ltd.hlaeja.library.deviceRegistry.Node
|
||||
import ltd.hlaeja.library.deviceRegistry.Nodes
|
||||
import ltd.hlaeja.library.deviceRegistry.Type
|
||||
import ltd.hlaeja.library.deviceRegistry.Types
|
||||
import org.springframework.http.HttpStatus.EXPECTATION_FAILED
|
||||
@@ -75,3 +76,11 @@ fun DeviceEntity.toDevicesResponse(): Devices.Response = Devices.Response(
|
||||
type,
|
||||
timestamp,
|
||||
)
|
||||
|
||||
fun NodeEntity.toNodesResponse(): Nodes.Response = Nodes.Response(
|
||||
id ?: throw ResponseStatusException(EXPECTATION_FAILED),
|
||||
timestamp,
|
||||
client,
|
||||
device,
|
||||
name,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user