🔥 Cleanup

This commit is contained in:
Amalie Mansåker 2023-08-07 10:32:47 +02:00
parent d97900e872
commit 8b5cc0c565
6 changed files with 5 additions and 33 deletions

View file

@ -1,13 +0,0 @@
package no.nav.helse.sprik
import kotlinx.serialization.*
@Serializable
data class Test (
var ord: String,
var tall: Int
) {
override fun toString(): String {
return "Test(ord='$ord', tall=$tall)"
}
}

View file

@ -16,7 +16,6 @@ import org.jetbrains.exposed.sql.transactions.transaction
class FeilmeldingRepository {
fun lagre(feilmelding: Feilmelding) {
transaction {
FeilmeldingTable.run {
insert {
@ -50,7 +49,6 @@ class FeilmeldingRepository {
fun hentSokteFeilmeldinger(sokeord: String): List<Feilmelding> = transaction {
val sok = "%${sokeord.lowercase().trim()}%"
FeilmeldingTable.select(
(FeilmeldingTable.tittel.lowerCase() like sok)
or (FeilmeldingTable.beskrivelse.lowerCase() like sok)

View file

@ -48,14 +48,6 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin
get("/isready"){
call.respondText("READY")
}
get("/api/test") {
call.respondText("test")
}
post("/api/nyfeil") {
val feilmelding = call.receive<Feilmelding>()
feilmeldingRepository.lagre(feilmelding)
call.respond(status = HttpStatusCode.Created, message = "Feilmelding motatt og sendt til database")
}
get("/api/hentallefeil"){
val testMelding = feilmeldingRepository.hentAlleFeilmeldinger()
call.respond(status = HttpStatusCode.Created, message = testMelding)
@ -66,6 +58,11 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin
val sokeresultat = feilmeldingRepository.hentSokteFeilmeldinger(sokestreng)
call.respond(status = HttpStatusCode.Created, message = sokeresultat)
}
post("/api/nyfeil") {
val feilmelding = call.receive<Feilmelding>()
feilmeldingRepository.lagre(feilmelding)
call.respond(status = HttpStatusCode.Created, message = "Feilmelding motatt og sendt til database")
}
put("/api/oppdaterfeil") {
val oppdatertFeilmelding = call.receive<Feilmelding>()
feilmeldingRepository.oppdaterFeilmelding(oppdatertFeilmelding)

View file

@ -1,5 +0,0 @@
package no.nav.helse.sprik
class ApplicationTest {
}

View file

@ -97,7 +97,6 @@ class FeilmeldingTest {
}
}
@Test
fun `Henter alle feilmeldinger i databasen`() {
feilmeldingRepository.lagre(feilmelding)

View file

@ -1,4 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1