Compare commits
7 Commits
main
...
0002350-en
Author | SHA1 | Date | |
---|---|---|---|
dc29e2c6b1 | |||
e0d64f91d1 | |||
af2b7cea6d | |||
488cab4ac7 | |||
8e417f02f2 | |||
728eca6dd6 | |||
e3fc1f73b7 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -41,4 +41,3 @@ bin/
|
|||||||
### Mac OS ###
|
### Mac OS ###
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea/.name
|
.idea/.name
|
||||||
*.log
|
|
||||||
|
@ -9,10 +9,6 @@ plugins {
|
|||||||
kotlin("plugin.serialization") version "1.9.23" // Aggiungi il plugin di Serialization
|
kotlin("plugin.serialization") version "1.9.23" // Aggiungi il plugin di Serialization
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
|
||||||
mainClass.set("eu.maiora.ApplicationKt")
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "org.maiora"
|
group = "org.maiora"
|
||||||
version = "1.0-SNAPSHOT"
|
version = "1.0-SNAPSHOT"
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
|
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
|
||||||
}
|
}
|
||||||
rootProject.name = "Backend_API"
|
rootProject.name = "Backend_API_DSU"
|
||||||
|
|
||||||
|
@ -9,26 +9,21 @@ import io.ktor.server.engine.*
|
|||||||
import io.ktor.server.netty.*
|
import io.ktor.server.netty.*
|
||||||
import io.ktor.server.plugins.callloging.*
|
import io.ktor.server.plugins.callloging.*
|
||||||
import io.ktor.server.plugins.cors.routing.*
|
import io.ktor.server.plugins.cors.routing.*
|
||||||
import java.io.FileInputStream
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
val properties = loadConfig()
|
embeddedServer(Netty, port = 8098, host = "0.0.0.0", module = Application::module)
|
||||||
val port = properties.getProperty("server.port").toInt()
|
.start(wait = true)
|
||||||
embeddedServer(Netty, port = port, host = "0.0.0.0") {
|
|
||||||
module(properties)
|
|
||||||
}.start(wait = true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Application.module(configFile: Properties) {
|
fun Application.module() {
|
||||||
val config = ApplicationConfig("application.conf")
|
val config = ApplicationConfig("application.conf")
|
||||||
val dbUrl = configFile.getProperty("ktor.database.url")
|
val dbUrl = config.property("ktor.database.url").getString()
|
||||||
val username = configFile.getProperty("ktor.database.username")
|
val username = config.property("ktor.database.username").getString()
|
||||||
val password = configFile.getProperty("ktor.database.password")
|
val password = config.property("ktor.database.password").getString()
|
||||||
val secret = config.property("ktor.jwt.secret").getString()
|
val secret = config.property("ktor.jwt.secret").getString()
|
||||||
configureDatabases(dbUrl, username, password)
|
configureDatabases(dbUrl, username, password)
|
||||||
configureSecurity(secret)
|
configureSecurity(secret)
|
||||||
configureRouting()
|
configureRouting(dbUrl, username, password)
|
||||||
configureSerialization()
|
configureSerialization()
|
||||||
|
|
||||||
install(CallLogging)
|
install(CallLogging)
|
||||||
@ -44,10 +39,3 @@ fun Application.module(configFile: Properties) {
|
|||||||
allowMethod(HttpMethod.Delete)
|
allowMethod(HttpMethod.Delete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadConfig(): Properties {
|
|
||||||
val properties = Properties()
|
|
||||||
val inputStream = FileInputStream("/home/backend_api/config.properties")
|
|
||||||
properties.load(inputStream)
|
|
||||||
return properties
|
|
||||||
}
|
|
||||||
|
@ -1,15 +1,22 @@
|
|||||||
package eu.maiora.db
|
package eu.maiora.db
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.deser.impl.CreatorCandidate.Param
|
|
||||||
import eu.maiora.model.Accounts
|
import eu.maiora.model.Accounts
|
||||||
|
import eu.maiora.model.Movimenti
|
||||||
import eu.maiora.model.Parametri
|
import eu.maiora.model.Parametri
|
||||||
|
import eu.maiora.model.Tessere
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import org.jetbrains.exposed.dao.IntEntity
|
import org.jetbrains.exposed.dao.IntEntity
|
||||||
import org.jetbrains.exposed.dao.IntEntityClass
|
import org.jetbrains.exposed.dao.IntEntityClass
|
||||||
|
import org.jetbrains.exposed.dao.LongEntity
|
||||||
|
import org.jetbrains.exposed.dao.LongEntityClass
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.dao.id.IdTable
|
import org.jetbrains.exposed.dao.id.IdTable
|
||||||
import org.jetbrains.exposed.sql.Transaction
|
import org.jetbrains.exposed.sql.Transaction
|
||||||
|
import org.jetbrains.exposed.sql.javatime.datetime
|
||||||
import org.jetbrains.exposed.sql.transactions.experimental.newSuspendedTransaction
|
import org.jetbrains.exposed.sql.transactions.experimental.newSuspendedTransaction
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
object AccountsTable : IdTable<Int>("accounts"){
|
object AccountsTable : IdTable<Int>("accounts"){
|
||||||
override val id = integer("id").entityId()
|
override val id = integer("id").entityId()
|
||||||
@ -27,6 +34,34 @@ object ParametriTable : IdTable<Int>("parametri"){
|
|||||||
override val primaryKey = PrimaryKey(id)
|
override val primaryKey = PrimaryKey(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object TessereTable : IdTable<Long>("view_tessere_api"){
|
||||||
|
override val id = long("id").entityId()
|
||||||
|
val idUtente = long("id_utente")
|
||||||
|
val codiceFiscale = varchar("codice_fiscale", 255)
|
||||||
|
val numero = varchar("numero", 255)
|
||||||
|
val saldo = double("saldo")
|
||||||
|
val punti = integer("punti")
|
||||||
|
|
||||||
|
override val primaryKey = PrimaryKey(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
object MovimentiTable : IdTable<Long>("view_movimenti_api"){
|
||||||
|
override val id = long("id").entityId()
|
||||||
|
val idTessera = long("id_tessera")
|
||||||
|
val numero = varchar("numero_tessera", 255)
|
||||||
|
val operazione = varchar("operazione", 255)
|
||||||
|
val dataMovimento = datetime("data_movimento")
|
||||||
|
val transazione = varchar("transazione", 255)
|
||||||
|
val dispositivo = varchar("dispositivo", 255)
|
||||||
|
val riferimento= varchar("riferimento", 255)
|
||||||
|
val saldoPre = double("saldo_pre")
|
||||||
|
val importo = double("importo")
|
||||||
|
val saldoPost = double("saldo_post")
|
||||||
|
val puntiPre = integer("punti_pre")
|
||||||
|
val punti = integer("punti")
|
||||||
|
val puntiPost = integer("punti_post")
|
||||||
|
}
|
||||||
|
|
||||||
class AccountsDAO(id: EntityID<Int>) :IntEntity(id) {
|
class AccountsDAO(id: EntityID<Int>) :IntEntity(id) {
|
||||||
companion object : IntEntityClass<AccountsDAO>(AccountsTable)
|
companion object : IntEntityClass<AccountsDAO>(AccountsTable)
|
||||||
|
|
||||||
@ -41,6 +76,34 @@ class ParametriDAO(id: EntityID<Int>) :IntEntity(id) {
|
|||||||
var valore by ParametriTable.valore
|
var valore by ParametriTable.valore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class TessereDao(id: EntityID<Long>) :LongEntity(id) {
|
||||||
|
companion object : LongEntityClass<TessereDao>(TessereTable)
|
||||||
|
|
||||||
|
var idUtente by TessereTable.idUtente
|
||||||
|
var codiceFiscale by TessereTable.codiceFiscale
|
||||||
|
var numero by TessereTable.numero
|
||||||
|
var saldo by TessereTable.saldo
|
||||||
|
var punti by TessereTable.punti
|
||||||
|
}
|
||||||
|
|
||||||
|
class MovimentiDao(id: EntityID<Long>) :LongEntity(id) {
|
||||||
|
companion object : LongEntityClass<MovimentiDao>(MovimentiTable)
|
||||||
|
|
||||||
|
var idTessera by MovimentiTable.idTessera
|
||||||
|
var numero by MovimentiTable.numero
|
||||||
|
var operazione by MovimentiTable.operazione
|
||||||
|
var dataMovimento by MovimentiTable.dataMovimento
|
||||||
|
var transazione by MovimentiTable.transazione
|
||||||
|
var dispositivo by MovimentiTable.dispositivo
|
||||||
|
var riferimento by MovimentiTable.riferimento
|
||||||
|
var saldoPre by MovimentiTable.saldoPre
|
||||||
|
var importo by MovimentiTable.importo
|
||||||
|
var saldoPost by MovimentiTable.saldoPost
|
||||||
|
var puntiPre by MovimentiTable.puntiPre
|
||||||
|
var punti by MovimentiTable.punti
|
||||||
|
var puntiPost by MovimentiTable.puntiPost
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun accountsDaoToModel(dao: AccountsDAO) = Accounts(
|
fun accountsDaoToModel(dao: AccountsDAO) = Accounts(
|
||||||
dao.id.value,
|
dao.id.value,
|
||||||
@ -54,6 +117,40 @@ fun parametriDaoToModel(dao: ParametriDAO) = Parametri(
|
|||||||
dao.valore
|
dao.valore
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun tessereDaoToModel(dao: TessereDao) = Tessere(
|
||||||
|
dao.id.value,
|
||||||
|
dao.idUtente,
|
||||||
|
dao.codiceFiscale,
|
||||||
|
dao.numero,
|
||||||
|
dao.saldo,
|
||||||
|
dao.punti
|
||||||
|
)
|
||||||
|
|
||||||
|
fun movimentiDaoToModel(dao: MovimentiDao) :Movimenti{
|
||||||
|
val formatter = DateTimeFormatter.ofPattern("ddMMyyyy HH:mm")
|
||||||
|
val formattedDate = dao.dataMovimento.format(formatter)
|
||||||
|
|
||||||
|
return Movimenti(
|
||||||
|
dao.id.value,
|
||||||
|
dao.idTessera,
|
||||||
|
dao.numero,
|
||||||
|
dao.operazione,
|
||||||
|
formattedDate,
|
||||||
|
dao.transazione,
|
||||||
|
dao.dispositivo,
|
||||||
|
dao.riferimento,
|
||||||
|
dao.saldoPre,
|
||||||
|
dao.importo,
|
||||||
|
dao.saldoPost,
|
||||||
|
dao.puntiPre,
|
||||||
|
dao.punti,
|
||||||
|
dao.puntiPost
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
suspend fun <T> suspendTransaction(block: Transaction.() -> T): T =
|
suspend fun <T> suspendTransaction(block: Transaction.() -> T): T =
|
||||||
newSuspendedTransaction(Dispatchers.IO, statement = block)
|
newSuspendedTransaction(Dispatchers.IO, statement = block)
|
22
src/main/kotlin/eu/maiora/model/Movimenti.kt
Normal file
22
src/main/kotlin/eu/maiora/model/Movimenti.kt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package eu.maiora.model
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Movimenti(
|
||||||
|
val id: Long,
|
||||||
|
val idTessera: Long,
|
||||||
|
val numero: String,
|
||||||
|
val operazione: String,
|
||||||
|
val dataMovimento: String,
|
||||||
|
val transazione: String,
|
||||||
|
val dispositivo: String,
|
||||||
|
val riferimento: String,
|
||||||
|
val saldoPre: Double,
|
||||||
|
val importo: Double,
|
||||||
|
val saldoPost: Double,
|
||||||
|
val puntiPre: Int,
|
||||||
|
val punti: Int,
|
||||||
|
val puntiPost: Int
|
||||||
|
)
|
5
src/main/kotlin/eu/maiora/model/MovimentiRepository.kt
Normal file
5
src/main/kotlin/eu/maiora/model/MovimentiRepository.kt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package eu.maiora.model
|
||||||
|
|
||||||
|
interface MovimentiRepository {
|
||||||
|
suspend fun movimentiByIdTessera(idTessera : Long): List<Movimenti>?
|
||||||
|
}
|
15
src/main/kotlin/eu/maiora/model/MovimentiRepositoryImpl.kt
Normal file
15
src/main/kotlin/eu/maiora/model/MovimentiRepositoryImpl.kt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package eu.maiora.model
|
||||||
|
|
||||||
|
import eu.maiora.db.*
|
||||||
|
import org.jetbrains.exposed.sql.SortOrder
|
||||||
|
|
||||||
|
class MovimentiRepositoryImpl : MovimentiRepository {
|
||||||
|
override suspend fun movimentiByIdTessera(idTessera : Long): List<Movimenti> = suspendTransaction {
|
||||||
|
// Cerca la lista di movimenti
|
||||||
|
MovimentiDao.find { MovimentiTable.idTessera eq idTessera }
|
||||||
|
.orderBy(MovimentiTable.dataMovimento to SortOrder.DESC)
|
||||||
|
.toList() // Restituisce la lista dei movimenti
|
||||||
|
.map { movimentiDaoToModel(it) } // Converte il DAO in un oggetto Movimenti
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
13
src/main/kotlin/eu/maiora/model/Tessere.kt
Normal file
13
src/main/kotlin/eu/maiora/model/Tessere.kt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package eu.maiora.model
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Tessere(
|
||||||
|
val id: Long,
|
||||||
|
val idUtente : Long,
|
||||||
|
val codiceFiscale : String,
|
||||||
|
val numero : String,
|
||||||
|
val saldo : Double,
|
||||||
|
val punti : Int
|
||||||
|
)
|
5
src/main/kotlin/eu/maiora/model/TessereRepository.kt
Normal file
5
src/main/kotlin/eu/maiora/model/TessereRepository.kt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package eu.maiora.model
|
||||||
|
|
||||||
|
interface TessereRepository {
|
||||||
|
suspend fun tesseraByCodiceFiscale(cf : String): Tessere?
|
||||||
|
}
|
13
src/main/kotlin/eu/maiora/model/TessereRepositoryImpl.kt
Normal file
13
src/main/kotlin/eu/maiora/model/TessereRepositoryImpl.kt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package eu.maiora.model
|
||||||
|
|
||||||
|
import eu.maiora.db.*
|
||||||
|
|
||||||
|
class TessereRepositoryImpl : TessereRepository {
|
||||||
|
override suspend fun tesseraByCodiceFiscale(cf: String): Tessere? = suspendTransaction {
|
||||||
|
// Cerca tessere in base al codice fiscale
|
||||||
|
TessereDao.find { TessereTable.codiceFiscale eq cf }
|
||||||
|
.singleOrNull() // Restituisce un singolo risultato o null se non trovato
|
||||||
|
?.let { tessereDaoToModel(it) } // Converte il DAO in un oggetto Tessere
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,29 @@
|
|||||||
package eu.maiora.plugins
|
package eu.maiora.plugins
|
||||||
|
|
||||||
|
//import eu.maiora.model.LogScriptRepositoryImpl
|
||||||
|
//import eu.maiora.routes.analizzaURLRoute
|
||||||
|
//import eu.maiora.routes.eseguiScriptSQLRoute
|
||||||
|
//import eu.maiora.routes.logScriptRouting
|
||||||
import eu.maiora.model.AccountsRepositoryImpl
|
import eu.maiora.model.AccountsRepositoryImpl
|
||||||
|
import eu.maiora.model.MovimentiRepositoryImpl
|
||||||
|
import eu.maiora.model.ParametriRepositoryImpl
|
||||||
|
import eu.maiora.model.TessereRepositoryImpl
|
||||||
import eu.maiora.routes.auth
|
import eu.maiora.routes.auth
|
||||||
|
import eu.maiora.routes.movimenti
|
||||||
|
import eu.maiora.routes.tessere
|
||||||
import io.ktor.server.application.*
|
import io.ktor.server.application.*
|
||||||
import io.ktor.server.response.*
|
import io.ktor.server.response.*
|
||||||
import io.ktor.server.routing.*
|
import io.ktor.server.routing.*
|
||||||
|
|
||||||
fun Application.configureRouting() {
|
//fun Application.configureRouting(dbUrl : String, username : String, password : String, repository : LogScriptRepositoryImpl ) {
|
||||||
|
fun Application.configureRouting(dbUrl : String, username : String, password : String) {
|
||||||
routing {
|
routing {
|
||||||
get("/") {
|
get("/") {
|
||||||
call.respondText("Hello World!")
|
call.respondText("Hello World!")
|
||||||
}
|
}
|
||||||
|
|
||||||
auth(AccountsRepositoryImpl())
|
auth(AccountsRepositoryImpl())
|
||||||
|
tessere(TessereRepositoryImpl())
|
||||||
|
movimenti(MovimentiRepositoryImpl())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import java.util.*
|
|||||||
|
|
||||||
|
|
||||||
fun Route.auth(accountsRepository: AccountsRepositoryImpl) {
|
fun Route.auth(accountsRepository: AccountsRepositoryImpl) {
|
||||||
route("/api/auth") {
|
route("/auth") {
|
||||||
post() {
|
post() {
|
||||||
// Riceve il body della richiesta e lo deserializza in ReceivedResponse
|
// Riceve il body della richiesta e lo deserializza in ReceivedResponse
|
||||||
val receivedResponse = try {
|
val receivedResponse = try {
|
||||||
@ -31,7 +31,7 @@ fun Route.auth(accountsRepository: AccountsRepositoryImpl) {
|
|||||||
logger.info(
|
logger.info(
|
||||||
"param: " +
|
"param: " +
|
||||||
receivedResponse.param
|
receivedResponse.param
|
||||||
)
|
);
|
||||||
|
|
||||||
// Decodifica la stringa da Base64 a oggetto Credentials
|
// Decodifica la stringa da Base64 a oggetto Credentials
|
||||||
val decodedBytes = Base64.getDecoder().decode(receivedResponse.param)
|
val decodedBytes = Base64.getDecoder().decode(receivedResponse.param)
|
||||||
|
36
src/main/kotlin/eu/maiora/routes/Movimenti.kt
Normal file
36
src/main/kotlin/eu/maiora/routes/Movimenti.kt
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package eu.maiora.routes
|
||||||
|
|
||||||
|
import eu.maiora.model.MovimentiRepositoryImpl
|
||||||
|
import io.ktor.http.*
|
||||||
|
import io.ktor.server.application.*
|
||||||
|
import io.ktor.server.auth.*
|
||||||
|
import io.ktor.server.response.*
|
||||||
|
import io.ktor.server.routing.*
|
||||||
|
|
||||||
|
|
||||||
|
fun Route.movimenti(movimentiRepository: MovimentiRepositoryImpl){
|
||||||
|
route("/api/movimenti"){
|
||||||
|
authenticate("auth-jwt") {
|
||||||
|
get("{idTessera}"){
|
||||||
|
// Ottieni l'id della tessera dal percorso
|
||||||
|
val idTessera = call.parameters["idTessera"]
|
||||||
|
|
||||||
|
if (idTessera == null) {
|
||||||
|
call.respondText("ID tessera non valido", status = HttpStatusCode.BadRequest)
|
||||||
|
return@get
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cerca la tessera per codice fiscale
|
||||||
|
val listaMovimenti = movimentiRepository.movimentiByIdTessera(idTessera.toLong())
|
||||||
|
|
||||||
|
|
||||||
|
if (listaMovimenti != null) {
|
||||||
|
call.respond(listaMovimenti)
|
||||||
|
} else {
|
||||||
|
call.respondText("Movimenti non trovati", status = HttpStatusCode.NotFound)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
35
src/main/kotlin/eu/maiora/routes/Tessere.kt
Normal file
35
src/main/kotlin/eu/maiora/routes/Tessere.kt
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package eu.maiora.routes
|
||||||
|
|
||||||
|
import eu.maiora.model.TessereRepositoryImpl
|
||||||
|
import io.ktor.http.*
|
||||||
|
import io.ktor.server.application.*
|
||||||
|
import io.ktor.server.auth.*
|
||||||
|
import io.ktor.server.response.*
|
||||||
|
import io.ktor.server.routing.*
|
||||||
|
|
||||||
|
|
||||||
|
fun Route.tessere(tessereRepository: TessereRepositoryImpl){
|
||||||
|
route("/api/tessere"){
|
||||||
|
authenticate("auth-jwt") {
|
||||||
|
get("{cf}"){
|
||||||
|
// Ottieni il codice fiscale dal percorso
|
||||||
|
val cf = call.parameters["cf"]
|
||||||
|
|
||||||
|
if (cf == null) {
|
||||||
|
call.respondText("Codice fiscale non valido", status = HttpStatusCode.BadRequest)
|
||||||
|
return@get
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cerca la tessera per codice fiscale
|
||||||
|
val tessera = tessereRepository.tesseraByCodiceFiscale(cf)
|
||||||
|
|
||||||
|
if (tessera != null) {
|
||||||
|
call.respond(tessera)
|
||||||
|
} else {
|
||||||
|
call.respondText("Tessera non trovata", status = HttpStatusCode.NotFound)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,18 @@
|
|||||||
ktor {
|
ktor {
|
||||||
|
database {
|
||||||
|
; url = "jdbc:postgresql://192.168.20.49:5432/caritas"
|
||||||
|
; username = "caritas"
|
||||||
|
; password = "caritas"
|
||||||
|
; driver = "org.postgresql.Driver"
|
||||||
|
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
|
||||||
|
url = "jdbc:sqlserver://192.168.20.45;databaseName=EP_FAER;integratedSecurity=false;encrypt=true;trustServerCertificate=true;"
|
||||||
|
username = "SA"
|
||||||
|
password = "I5fz9l1a"
|
||||||
|
;driver = "oracle.jdbc.OracleDriver"
|
||||||
|
;url = "jdbc:oracle:thin:@//192.168.20.101:1521/SIR"
|
||||||
|
;username = "EP_DONORIONE"
|
||||||
|
;password = "ep_donorione"
|
||||||
|
}
|
||||||
jwt {
|
jwt {
|
||||||
# secret per JWT generato partendo dalla stringa '?Backend_API*06022025!' codificato in Base64
|
# secret per JWT generato partendo dalla stringa '?Backend_API*06022025!' codificato in Base64
|
||||||
secret = "P0JhY2tlbmRfQVBJKjA2MDIyMDI1IQ=="
|
secret = "P0JhY2tlbmRfQVBJKjA2MDIyMDI1IQ=="
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
<configuration>
|
|
||||||
|
|
||||||
<!-- Appender per la console -->
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Appender per il file di log con rotazione basata su tempo e dimensione -->
|
|
||||||
<appender name="ROLLING_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>./log/logFile.log</file> <!-- File di log principale -->
|
|
||||||
<append>true</append>
|
|
||||||
|
|
||||||
<!-- RollingPolicy per dimensione e tempo -->
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<!-- Pattern per il nome dei file ruotati: include la data -->
|
|
||||||
<FileNamePattern>./log/logFile.%d{yyyy-MM-dd}.%i.log</FileNamePattern> <!-- %i è il numero di file generato -->
|
|
||||||
|
|
||||||
<!-- Limita la dimensione del file a 100MB -->
|
|
||||||
<maxFileSize>100MB</maxFileSize> <!-- Ruota il file quando raggiunge 100MB -->
|
|
||||||
|
|
||||||
<!-- Conserva i log per due settimane -->
|
|
||||||
<maxHistory>15</maxHistory> <!-- Limita a 15 giorni i log archiviati -->
|
|
||||||
|
|
||||||
<!-- Limita la dimensione totale dei file di log a 5GB -->
|
|
||||||
<totalSizeCap>5GB</totalSizeCap>
|
|
||||||
</rollingPolicy>
|
|
||||||
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Configurazione del livello di log -->
|
|
||||||
<root level="DEBUG">
|
|
||||||
<appender-ref ref="ROLLING_FILE"/>
|
|
||||||
<appender-ref ref="STDOUT"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
<logger name="io.netty" level="INFO"/>
|
|
||||||
|
|
||||||
</configuration>
|
|
Loading…
Reference in New Issue
Block a user