diff --git a/src/main/kotlin/routes/LoginRoutes.kt b/src/main/kotlin/routes/LoginRoutes.kt index 5877418..f4e58f5 100644 --- a/src/main/kotlin/routes/LoginRoutes.kt +++ b/src/main/kotlin/routes/LoginRoutes.kt @@ -18,7 +18,6 @@ fun Application.configureLoginRoutes(dbConnection: Connection) { val secret = environment.config.property("jwt.secret").getString() val issuer = environment.config.property("jwt.issuer").getString() val audience = environment.config.property("jwt.audience").getString() - val myRealm = environment.config.property("jwt.realm").getString() val patronService = PatronService(dbConnection) routing { diff --git a/src/main/kotlin/service/PatronService.kt b/src/main/kotlin/service/PatronService.kt index befa10f..95bc5fa 100644 --- a/src/main/kotlin/service/PatronService.kt +++ b/src/main/kotlin/service/PatronService.kt @@ -21,7 +21,7 @@ class PatronService(private val connection: Connection) { private const val ARCHIVE_PATRON_BY_ID = "UPDATE patron set is_archived = true WHERE id = ?" } - suspend fun create(newPatron: NewPatron): Long { + fun create(newPatron: NewPatron): Long { val statement = connection.prepareStatement(INSERT_PATRON, Statement.RETURN_GENERATED_KEYS) statement.setString(1, newPatron.name) statement.setBoolean(2, true) @@ -42,7 +42,7 @@ class PatronService(private val connection: Connection) { } } - suspend fun readPatronById(id: Long): Patron { + fun readPatronById(id: Long): Patron { try { val statement = connection.prepareStatement(SELECT_PATRON_BY_ID, Statement.RETURN_GENERATED_KEYS) statement.setLong(1, id) @@ -58,7 +58,7 @@ class PatronService(private val connection: Connection) { } } - suspend fun readPatronByLoginUsername(username: String): Patron { + fun readPatronByLoginUsername(username: String): Patron { try { val statement = connection.prepareStatement(SELECT_PATRON_BY_LOGIN_USERNAME) statement.setString(1, username) @@ -74,7 +74,7 @@ class PatronService(private val connection: Connection) { } } - suspend fun loginPatronByLoginUsername(username: String, password: String): Boolean { + fun loginPatronByLoginUsername(username: String, password: String): Boolean { try { val statement = connection.prepareStatement(SELECT_PATRON_BY_LOGIN_USERNAME) statement.setString(1, username) @@ -89,7 +89,7 @@ class PatronService(private val connection: Connection) { } } - suspend fun update(patron: Patron): Boolean { + fun update(patron: Patron): Boolean { val statement = connection.prepareStatement(UPDATE_PATRON_BY_ID) statement.setString(1, patron.name) statement.setBoolean(2, patron.hasGoodStanding) @@ -106,7 +106,7 @@ class PatronService(private val connection: Connection) { } } - suspend fun delete(id: Long) { + fun delete(id: Long) { val statement = connection.prepareStatement(ARCHIVE_PATRON_BY_ID) statement.setLong(1, id) try {