From de21f2fe3917f3d1112938b2e3a747cf1f9597e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Sun, 17 Mar 2024 17:07:43 +0100 Subject: [PATCH 01/18] added endpoints --- .../fg/hilflingbackend/controller/AlbumController.kt | 8 ++++++++ .../hilflingbackend/controller/MotiveController.kt | 7 ++++++- .../fg/hilflingbackend/controller/PlaceController.kt | 11 ++++++++++- .../fg/hilflingbackend/repository/AlbumRepository.kt | 12 ++++++++++++ .../hilflingbackend/repository/MotiveRepository.kt | 6 ++++++ .../fg/hilflingbackend/repository/PlaceRepository.kt | 8 ++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt index 599713ff..3ff0877a 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt @@ -9,6 +9,9 @@ import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import java.util.UUID @RestController @RequestMapping("/albums") @@ -23,4 +26,9 @@ class AlbumController(override val repository: AlbumRepository, val service: Alb dto ) } + + @GetMapping("/getUuidByTitle") + fun getAlbumIdByName(@RequestParam("albumTitle") albumTitle: String): UUID? { + return repository.findUuidByMotive(albumTitle) + } } diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt index 1e33bf24..53388bfa 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt @@ -34,6 +34,11 @@ class MotiveController { return repository.findAll(page ?: 0, pageSize ?: 100) } + @GetMapping("/getUuidByTitle") + fun getAlbumIdByName(@RequestParam("motiveTitle") motiveTitle: String): UUID? { + return repository.findUuidByMotive(motiveTitle) + } + @PostMapping fun create( @RequestBody dto: MotiveDto @@ -49,4 +54,4 @@ class MotiveController { ): MotiveDto { return repository.patch(dto) } -} +} \ No newline at end of file diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index b8adb80d..c75ce6d7 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -4,9 +4,18 @@ import no.fg.hilflingbackend.dto.PlaceDto import no.fg.hilflingbackend.dto.PlacePatchRequestDto import no.fg.hilflingbackend.model.Place import no.fg.hilflingbackend.repository.PlaceRepository +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController +import java.util.UUID @RestController @RequestMapping("/places") -open class PlaceController(override val repository: PlaceRepository) : BaseController(repository) +open class PlaceController(override val repository: PlaceRepository) : BaseController(repository) { + + @GetMapping("/getUuidByTitle") + fun getUuidByPlace(@RequestParam("placeTitle") placeTitle: String): UUID? { + return repository.findUuidByPlace(placeTitle) + } +} diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt index 38056f2a..aa79cf83 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt @@ -2,6 +2,11 @@ package no.fg.hilflingbackend.repository import me.liuwj.ktorm.database.Database import me.liuwj.ktorm.dsl.QueryRowSet +import me.liuwj.ktorm.dsl.from +import me.liuwj.ktorm.dsl.where +import me.liuwj.ktorm.dsl.select +import me.liuwj.ktorm.dsl.eq +import me.liuwj.ktorm.entity.find import me.liuwj.ktorm.entity.add import me.liuwj.ktorm.entity.update import no.fg.hilflingbackend.dto.AlbumDto @@ -13,6 +18,7 @@ import no.fg.hilflingbackend.model.Albums import no.fg.hilflingbackend.model.albums import org.springframework.stereotype.Repository import javax.persistence.EntityNotFoundException +import java.util.UUID @Repository open class AlbumRepository(database: Database) : BaseRepository(table = Albums, database = database) { @@ -38,4 +44,10 @@ open class AlbumRepository(database: Database) : BaseRepository(table = Places, database = database) { @@ -47,4 +48,11 @@ open class PlaceRepository(database: Database) : BaseRepository Date: Mon, 18 Mar 2024 13:32:59 +0100 Subject: [PATCH 02/18] fixed eslint errors --- .../no/fg/hilflingbackend/controller/AlbumController.kt | 5 ++++- .../no/fg/hilflingbackend/controller/MotiveController.kt | 5 ++++- .../no/fg/hilflingbackend/controller/PlaceController.kt | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt index 3ff0877a..e76b732f 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt @@ -28,7 +28,10 @@ class AlbumController(override val repository: AlbumRepository, val service: Alb } @GetMapping("/getUuidByTitle") - fun getAlbumIdByName(@RequestParam("albumTitle") albumTitle: String): UUID? { + fun getAlbumIdByName( + @RequestParam("albumTitle") albumTitle: String + ): UUID? { return repository.findUuidByMotive(albumTitle) } + } diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt index 53388bfa..ac38aa3e 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt @@ -35,9 +35,12 @@ class MotiveController { } @GetMapping("/getUuidByTitle") - fun getAlbumIdByName(@RequestParam("motiveTitle") motiveTitle: String): UUID? { + fun getAlbumIdByName( + @RequestParam("motiveTitle") motiveTitle: String + ): UUID? { return repository.findUuidByMotive(motiveTitle) } + @PostMapping fun create( diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index c75ce6d7..b9a7f21f 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -15,7 +15,9 @@ import java.util.UUID open class PlaceController(override val repository: PlaceRepository) : BaseController(repository) { @GetMapping("/getUuidByTitle") - fun getUuidByPlace(@RequestParam("placeTitle") placeTitle: String): UUID? { + fun getUuidByPlace( + @RequestParam("placeTitle") placeTitle: String + ): UUID? { return repository.findUuidByPlace(placeTitle) - } + } } From 9573cf44cb022918b50490106fa1a473248c73f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 13:42:43 +0100 Subject: [PATCH 03/18] fix linting errors --- .../no/fg/hilflingbackend/controller/AlbumController.kt | 6 +++--- .../no/fg/hilflingbackend/controller/MotiveController.kt | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt index e76b732f..a09a0333 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt @@ -29,9 +29,9 @@ class AlbumController(override val repository: AlbumRepository, val service: Alb @GetMapping("/getUuidByTitle") fun getAlbumIdByName( - @RequestParam("albumTitle") albumTitle: String + @RequestParam( + "albumTitle",) albumTitle: String ): UUID? { - return repository.findUuidByMotive(albumTitle) + return repository.findUuidByMotive(albumTitle) } - } diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt index ac38aa3e..8fc1a647 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt @@ -36,9 +36,10 @@ class MotiveController { @GetMapping("/getUuidByTitle") fun getAlbumIdByName( - @RequestParam("motiveTitle") motiveTitle: String + @RequestParam( + "motiveTitle",) motiveTitle: String ): UUID? { - return repository.findUuidByMotive(motiveTitle) + return repository.findUuidByMotive(motiveTitle) } @@ -57,4 +58,4 @@ class MotiveController { ): MotiveDto { return repository.patch(dto) } -} \ No newline at end of file +} From 3757c070bf1020620605d3fc9a9a4d7a3fb3af84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 13:48:50 +0100 Subject: [PATCH 04/18] fix linting error 2 --- .../no/fg/hilflingbackend/controller/AlbumController.kt | 3 ++- .../no/fg/hilflingbackend/controller/MotiveController.kt | 3 ++- .../no/fg/hilflingbackend/controller/PlaceController.kt | 4 +++- .../no/fg/hilflingbackend/repository/AlbumRepository.kt | 4 +++- .../no/fg/hilflingbackend/repository/MotiveRepository.kt | 8 ++++++-- .../no/fg/hilflingbackend/repository/PlaceRepository.kt | 8 ++++++-- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt index a09a0333..07d91c9c 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt @@ -30,7 +30,8 @@ class AlbumController(override val repository: AlbumRepository, val service: Alb @GetMapping("/getUuidByTitle") fun getAlbumIdByName( @RequestParam( - "albumTitle",) albumTitle: String + "albumTitle" + ) albumTitle: String ): UUID? { return repository.findUuidByMotive(albumTitle) } diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt index 8fc1a647..2e71fca5 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt @@ -37,7 +37,8 @@ class MotiveController { @GetMapping("/getUuidByTitle") fun getAlbumIdByName( @RequestParam( - "motiveTitle",) motiveTitle: String + "motiveTitle" + ) motiveTitle: String ): UUID? { return repository.findUuidByMotive(motiveTitle) } diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index b9a7f21f..bea76a80 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -16,7 +16,9 @@ open class PlaceController(override val repository: PlaceRepository) : BaseContr @GetMapping("/getUuidByTitle") fun getUuidByPlace( - @RequestParam("placeTitle") placeTitle: String + @RequestParam( + "placeTitle" + ) placeTitle: String ): UUID? { return repository.findUuidByPlace(placeTitle) } diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt index aa79cf83..a8d0a707 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt @@ -47,7 +47,9 @@ open class AlbumRepository(database: Database) : BaseRepository Date: Mon, 18 Mar 2024 14:00:38 +0100 Subject: [PATCH 05/18] fixed linting errors on controllers --- .../no/fg/hilflingbackend/controller/AlbumController.kt | 4 ++-- .../no/fg/hilflingbackend/controller/MotiveController.kt | 5 ++--- .../no/fg/hilflingbackend/controller/PlaceController.kt | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt index 07d91c9c..d21730ef 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/AlbumController.kt @@ -30,8 +30,8 @@ class AlbumController(override val repository: AlbumRepository, val service: Alb @GetMapping("/getUuidByTitle") fun getAlbumIdByName( @RequestParam( - "albumTitle" - ) albumTitle: String + "albumTitle", + ) albumTitle: String, ): UUID? { return repository.findUuidByMotive(albumTitle) } diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt index 2e71fca5..a6c633ef 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/MotiveController.kt @@ -37,12 +37,11 @@ class MotiveController { @GetMapping("/getUuidByTitle") fun getAlbumIdByName( @RequestParam( - "motiveTitle" - ) motiveTitle: String + "motiveTitle", + ) motiveTitle: String, ): UUID? { return repository.findUuidByMotive(motiveTitle) } - @PostMapping fun create( diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index bea76a80..b27266dc 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -13,13 +13,12 @@ import java.util.UUID @RestController @RequestMapping("/places") open class PlaceController(override val repository: PlaceRepository) : BaseController(repository) { - @GetMapping("/getUuidByTitle") fun getUuidByPlace( @RequestParam( - "placeTitle" - ) placeTitle: String + "placeTitle", + ) placeTitle: String, ): UUID? { return repository.findUuidByPlace(placeTitle) - } + } } From 95e679136b57bc131a974135c85dcce331931340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:16:58 +0100 Subject: [PATCH 06/18] fixed linting error in place controller --- .../fg/hilflingbackend/controller/PlaceController.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index b27266dc..1678c43e 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -13,11 +13,11 @@ import java.util.UUID @RestController @RequestMapping("/places") open class PlaceController(override val repository: PlaceRepository) : BaseController(repository) { - @GetMapping("/getUuidByTitle") - fun getUuidByPlace( - @RequestParam( - "placeTitle", - ) placeTitle: String, +@GetMapping("/getUuidByTitle") +fun getUuidByPlace( + @RequestParam( + "placeTitle", + ) placeTitle: String, ): UUID? { return repository.findUuidByPlace(placeTitle) } From 2c16ee586605720d92cc8cd3bb98f02e787560d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:20:19 +0100 Subject: [PATCH 07/18] still linting... --- .../fg/hilflingbackend/controller/PlaceController.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index 1678c43e..ce4a0e26 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -13,12 +13,12 @@ import java.util.UUID @RestController @RequestMapping("/places") open class PlaceController(override val repository: PlaceRepository) : BaseController(repository) { -@GetMapping("/getUuidByTitle") -fun getUuidByPlace( - @RequestParam( + @GetMapping("/getUuidByTitle") + fun getUuidByPlace( + @RequestParam( "placeTitle", - ) placeTitle: String, - ): UUID? { + ) placeTitle: String, + ): UUID? { return repository.findUuidByPlace(placeTitle) - } + } } From 910dc6a2f286ac9baf5b82df4f8a0d0bbc58e939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:27:29 +0100 Subject: [PATCH 08/18] fix lint --- .../no/fg/hilflingbackend/controller/PlaceController.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index ce4a0e26..68dbfbf3 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -15,10 +15,10 @@ import java.util.UUID open class PlaceController(override val repository: PlaceRepository) : BaseController(repository) { @GetMapping("/getUuidByTitle") fun getUuidByPlace( - @RequestParam( - "placeTitle", - ) placeTitle: String, - ): UUID? { + @RequestParam( + "placeTitle", + ) placeTitle: String, + ): UUID? { return repository.findUuidByPlace(placeTitle) } } From 822e34fc6f292d7a468c71bff4500b3d9df62596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:30:15 +0100 Subject: [PATCH 09/18] place controller linting error --- .../kotlin/no/fg/hilflingbackend/controller/PlaceController.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index 68dbfbf3..cfe6d481 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -18,7 +18,8 @@ open class PlaceController(override val repository: PlaceRepository) : BaseContr @RequestParam( "placeTitle", ) placeTitle: String, + ): UUID? { return repository.findUuidByPlace(placeTitle) - } + } } From 71e4eb7b97bcec51ea7ee4f8b023ccaf5f3bbc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:32:19 +0100 Subject: [PATCH 10/18] place controller linting error --- .../kotlin/no/fg/hilflingbackend/controller/PlaceController.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index cfe6d481..7fa2511a 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -18,8 +18,7 @@ open class PlaceController(override val repository: PlaceRepository) : BaseContr @RequestParam( "placeTitle", ) placeTitle: String, - ): UUID? { - return repository.findUuidByPlace(placeTitle) + return repository.findUuidByPlace(placeTitle) } } From ae14efaff837ee47e7e1307838b44e5d1c62d4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:36:01 +0100 Subject: [PATCH 11/18] fix unused imports --- .../kotlin/no/fg/hilflingbackend/controller/PlaceController.kt | 2 +- .../kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt index 7fa2511a..8c7d9a90 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/controller/PlaceController.kt @@ -18,7 +18,7 @@ open class PlaceController(override val repository: PlaceRepository) : BaseContr @RequestParam( "placeTitle", ) placeTitle: String, - ): UUID? { + ): UUID? { return repository.findUuidByPlace(placeTitle) } } diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt index a8d0a707..87a019dc 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt @@ -2,9 +2,6 @@ package no.fg.hilflingbackend.repository import me.liuwj.ktorm.database.Database import me.liuwj.ktorm.dsl.QueryRowSet -import me.liuwj.ktorm.dsl.from -import me.liuwj.ktorm.dsl.where -import me.liuwj.ktorm.dsl.select import me.liuwj.ktorm.dsl.eq import me.liuwj.ktorm.entity.find import me.liuwj.ktorm.entity.add From f1419e5073f61511d5e4cad6ecd6582d4d27033a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:39:40 +0100 Subject: [PATCH 12/18] fix linting error on albumrepository --- .../no/fg/hilflingbackend/repository/AlbumRepository.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt index 87a019dc..5980b604 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt @@ -43,10 +43,12 @@ open class AlbumRepository(database: Database) : BaseRepository Date: Mon, 18 Mar 2024 14:44:46 +0100 Subject: [PATCH 13/18] fix linting error on albumrepository --- .../no/fg/hilflingbackend/repository/AlbumRepository.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt index 5980b604..e73cd3e4 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt @@ -43,12 +43,13 @@ open class AlbumRepository(database: Database) : BaseRepository Date: Mon, 18 Mar 2024 14:47:05 +0100 Subject: [PATCH 14/18] fix linting error on albumrepository --- .../hilflingbackend/repository/AlbumRepository.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt index e73cd3e4..350d61d7 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/AlbumRepository.kt @@ -43,13 +43,13 @@ open class AlbumRepository(database: Database) : BaseRepository Date: Mon, 18 Mar 2024 14:51:11 +0100 Subject: [PATCH 15/18] fix motiverepository linting --- .../no/fg/hilflingbackend/repository/MotiveRepository.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt index a0224e10..c9673ddc 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt @@ -79,11 +79,12 @@ open class MotiveRepository { } fun findUuidByMotive(motiveName:String): UUID? { - val motive = database.motives.find { + val motive = + database.motives.find { it.title eq motiveName } ?: throw EntityNotFoundException( - "could not find matching place" + "could not find matching place", ) return motive.id } From 6d1c345b42d904003b829452bf1c0c636c261e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:53:01 +0100 Subject: [PATCH 16/18] fix motiverepository linting --- .../hilflingbackend/repository/MotiveRepository.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt index c9673ddc..b813bf61 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/MotiveRepository.kt @@ -78,13 +78,13 @@ open class MotiveRepository { return if (updated == 1) newDto else fromDb } - fun findUuidByMotive(motiveName:String): UUID? { + fun findUuidByMotive(motiveName: String): UUID? { val motive = - database.motives.find { - it.title eq motiveName - } - ?: throw EntityNotFoundException( - "could not find matching place", + database.motives.find { + it.title eq motiveName + } + ?: throw EntityNotFoundException( + "could not find matching place", ) return motive.id } From b183fdcc9b867e2229669d36e1486ba157d524f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B8lset=20Gisleberg?= Date: Mon, 18 Mar 2024 14:54:31 +0100 Subject: [PATCH 17/18] fixed linting on PlaceRepository --- .../hilflingbackend/repository/PlaceRepository.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt index 275fe074..b2268484 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt @@ -49,12 +49,13 @@ open class PlaceRepository(database: Database) : BaseRepository Date: Mon, 18 Mar 2024 14:55:38 +0100 Subject: [PATCH 18/18] fixed blank space --- .../kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt b/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt index b2268484..b10f4c32 100644 --- a/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt +++ b/src/main/kotlin/no/fg/hilflingbackend/repository/PlaceRepository.kt @@ -59,5 +59,4 @@ open class PlaceRepository(database: Database) : BaseRepository