🔥 Cleanup
This commit is contained in:
		
							parent
							
								
									d97900e872
								
							
						
					
					
						commit
						8b5cc0c565
					
				
					 6 changed files with 5 additions and 33 deletions
				
			
		|  | @ -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)" | ||||
|     } | ||||
| } | ||||
|  | @ -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) | ||||
|  |  | |||
|  | @ -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) | ||||
|  |  | |||
|  | @ -1,5 +0,0 @@ | |||
| package no.nav.helse.sprik | ||||
| 
 | ||||
| 
 | ||||
| class ApplicationTest { | ||||
| } | ||||
|  | @ -97,7 +97,6 @@ class FeilmeldingTest { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Test | ||||
|     fun `Henter alle feilmeldinger i databasen`() { | ||||
|         feilmeldingRepository.lagre(feilmelding) | ||||
|  |  | |||
		Reference in a new issue
	
	 Amalie Mansåker
						Amalie Mansåker