update project
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
plugins {
|
||||
alias(hlaeja.plugins.kotlin.jvm)
|
||||
alias(hlaeja.plugins.kotlin.spring)
|
||||
alias(hlaeja.plugins.ltd.hlaeja.plugin.service)
|
||||
alias(hlaeja.plugins.spring.boot)
|
||||
alias(hlaeja.plugins.spring.dependency.management)
|
||||
alias(hlaeja.plugins.springframework.boot)
|
||||
alias(hlaeja.plugins.service)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -11,7 +11,7 @@ dependencies {
|
||||
implementation(hlaeja.kotlin.logging)
|
||||
implementation(hlaeja.kotlin.reflect)
|
||||
implementation(hlaeja.kotlinx.coroutines)
|
||||
implementation(hlaeja.library.hlaeja.common.messages)
|
||||
implementation(hlaeja.library.common.messages)
|
||||
implementation(hlaeja.springboot.starter.actuator)
|
||||
implementation(hlaeja.springboot.starter.cassandra)
|
||||
implementation(hlaeja.springboot.starter.cassandra.reactive)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
kotlin.code.style=official
|
||||
version=0.2.0-SNAPSHOT
|
||||
catalog=0.5.0
|
||||
catalog=0.11.0-SNAPSHOT
|
||||
container.port.host=9030
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package ltd.hlaeja.controller
|
||||
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||
import java.util.UUID
|
||||
import ltd.hlaeja.library.deviceConfiguration.Node
|
||||
import ltd.hlaeja.service.NodeService
|
||||
import ltd.hlaeja.util.toEntity
|
||||
import ltd.hlaeja.util.toResponse
|
||||
import mu.KotlinLogging
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.PathVariable
|
||||
import org.springframework.web.bind.annotation.PutMapping
|
||||
@@ -25,7 +25,7 @@ class NodeController(
|
||||
@PathVariable node: UUID,
|
||||
): Mono<Node.Response> = service.getConfiguration(node)
|
||||
.map { it.toResponse() }
|
||||
.also { log.debug("Endpoint getNodeConfiguration for node: {}", node) }
|
||||
.also { log.debug { "Endpoint getNodeConfiguration for node: $node" } }
|
||||
|
||||
@PutMapping("/node-{node}")
|
||||
fun updateNodeConfiguration(
|
||||
@@ -33,5 +33,5 @@ class NodeController(
|
||||
@RequestBody nodeRequest: Node.Request,
|
||||
): Mono<Node.Response> = service.updateDevice(nodeRequest.toEntity(node))
|
||||
.map { it.toResponse() }
|
||||
.also { log.debug("Endpoint updateNodeConfiguration for node: {}", node) }
|
||||
.also { log.debug { "Endpoint updateNodeConfiguration for node: $node" } }
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package ltd.hlaeja.service
|
||||
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||
import java.util.UUID
|
||||
import ltd.hlaeja.entity.NodeEntity
|
||||
import ltd.hlaeja.repository.NodeRepository
|
||||
import mu.KotlinLogging
|
||||
import org.springframework.stereotype.Service
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.http.HttpStatus.NOT_FOUND
|
||||
import org.springframework.stereotype.Service
|
||||
import org.springframework.web.server.ResponseStatusException
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
private val log = KotlinLogging.logger {}
|
||||
|
||||
|
||||
@@ -16,6 +16,20 @@ spring:
|
||||
schema-action: none
|
||||
local-datacenter: datacenter1
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
access:
|
||||
default: none
|
||||
web:
|
||||
exposure:
|
||||
include: "health,info"
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
access: read_only
|
||||
info:
|
||||
access: read_only
|
||||
|
||||
---
|
||||
###############################
|
||||
### Development environment ###
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
<logger level="DEBUG" name="ltd.hlaeja"/>
|
||||
</configuration>
|
||||
@@ -1,9 +1,9 @@
|
||||
package ltd.hlaeja
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
// import org.springframework.boot.test.context.SpringBootTest
|
||||
|
||||
@SpringBootTest
|
||||
// @SpringBootTest
|
||||
class ApplicationTests {
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user