From 4dd2b0d8ec4802f8fc98c9a31163cd052a69c98d Mon Sep 17 00:00:00 2001 From: forge-bot Date: Tue, 14 Jul 2026 06:31:59 +0000 Subject: [PATCH] =?UTF-8?q?TA=20=EC=97=AD=ED=95=A0=20Spring=20=EA=B2=BD?= =?UTF-8?q?=EA=B3=84=20smoke=20(role-ta-live-1522-001)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/RoleMatrixController.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/main/java/com/klaroworks/runtime/rolematrix/controller/RoleMatrixController.java diff --git a/src/main/java/com/klaroworks/runtime/rolematrix/controller/RoleMatrixController.java b/src/main/java/com/klaroworks/runtime/rolematrix/controller/RoleMatrixController.java new file mode 100644 index 0000000..c2f85d8 --- /dev/null +++ b/src/main/java/com/klaroworks/runtime/rolematrix/controller/RoleMatrixController.java @@ -0,0 +1,50 @@ +package com.klaroworks.runtime.rolematrix.controller; + +import com.klaroworks.runtime.rolematrix.dto.CreateRoleMatrixCommand; +import com.klaroworks.runtime.rolematrix.dto.RoleMatrixResponse; +import com.klaroworks.runtime.rolematrix.dto.UpdateRoleMatrixCommand; +import com.klaroworks.runtime.rolematrix.service.RoleMatrixService; +import jakarta.validation.Valid; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** 역할 매트릭스 REST 컨트롤러 - HTTP 요청/응답 변환, 입력 검증 */ +@RestController +@RequestMapping("/api/v1/role-matrices") +public class RoleMatrixController { + + private final RoleMatrixService roleMatrixService; + + public RoleMatrixController(RoleMatrixService roleMatrixService) { + this.roleMatrixService = roleMatrixService; + } + + @GetMapping + public ResponseEntity> findAll() { + return ResponseEntity.ok(roleMatrixService.findAll()); + } + + @GetMapping("/{id}") + public ResponseEntity findById(@PathVariable Long id) { + return ResponseEntity.ok(roleMatrixService.findById(id)); + } + + @PostMapping + public ResponseEntity create(@Valid @RequestBody CreateRoleMatrixCommand command) { + return ResponseEntity.status(HttpStatus.CREATED).body(roleMatrixService.create(command)); + } + + @PutMapping("/{id}") + public ResponseEntity update(@PathVariable Long id, @Valid @RequestBody UpdateRoleMatrixCommand command) { + return ResponseEntity.ok(roleMatrixService.update(id, command)); + } + + @DeleteMapping("/{id}") + public ResponseEntity delete(@PathVariable Long id) { + roleMatrixService.delete(id); + return ResponseEntity.noContent().build(); + } +}