Initial MatrixService and added kotlin-logging
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package eu.fosil.okupamicoche.spring.services
|
||||
|
||||
import eu.fosil.okupamicoche.usecases.MatrixApi
|
||||
import mu.KotlinLogging
|
||||
import net.folivo.matrix.core.model.MatrixId
|
||||
import net.folivo.matrix.restclient.MatrixClient
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class MatrixService(val matrixClient: MatrixClient): MatrixApi {
|
||||
private val logger = KotlinLogging.logger {}
|
||||
|
||||
override suspend fun createRoom(name: String) {
|
||||
logger.debug { "Creating room name" }
|
||||
matrixClient.roomsApi.createRoom(name = name, roomAliasId = MatrixId.RoomAliasId("#$name:synapse"))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package eu.fosil.okupamicoche.usecases
|
||||
|
||||
interface MatrixApi {
|
||||
suspend fun createRoom(name: String)
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
server:
|
||||
port: 8081
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: org.h2.Driver
|
||||
@@ -14,6 +15,10 @@ spring:
|
||||
jwt:
|
||||
issuer-uri: http://localhost:8080/auth/realms/okupamicoche
|
||||
|
||||
logging:
|
||||
level:
|
||||
eu.fosil.okupamicoche: DEBUG
|
||||
|
||||
matrix:
|
||||
bot:
|
||||
# The domain-part of matrix-ids. E. g. example.org when your userIds look like @unicorn:example.org
|
||||
|
||||
Reference in New Issue
Block a user