From 263adb15f92e9db358f1d9a1968869bcf2f7dcd3 Mon Sep 17 00:00:00 2001 From: "B.E.N.S.O.N" Date: Fri, 6 Mar 2026 18:33:28 +0800 Subject: [PATCH] Bom Supporting Function --- .../modules/master/web/BomScoreController.kt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/main/java/com/ffii/fpsms/modules/master/web/BomScoreController.kt diff --git a/src/main/java/com/ffii/fpsms/modules/master/web/BomScoreController.kt b/src/main/java/com/ffii/fpsms/modules/master/web/BomScoreController.kt new file mode 100644 index 0000000..e504977 --- /dev/null +++ b/src/main/java/com/ffii/fpsms/modules/master/web/BomScoreController.kt @@ -0,0 +1,31 @@ +package com.ffii.fpsms.modules.master.web + +import com.ffii.fpsms.modules.master.entity.BomRepository +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +data class BomScoreDto( + val id: Long?, + val code: String?, + val name: String?, + val baseScore: java.math.BigDecimal?, +) + +@RestController +@RequestMapping("/bom/scores") +class BomScoreController( + private val bomRepository: BomRepository, +) { + @GetMapping + fun getBomScores(): List { + return bomRepository.findAllByDeletedIsFalse().map { bom -> + BomScoreDto( + id = bom.id, + code = bom.code, + name = bom.name, + baseScore = bom.baseScore, + ) + } + } +}