package com.tcm.training.admin.system.controller; import com.tcm.training.admin.common.ApiResponse; import com.tcm.training.admin.system.dto.AgreementContentSaveRequest; import com.tcm.training.admin.system.service.AgreementContentAppService; import com.tcm.training.admin.system.vo.AgreementContentItemVO; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; import java.util.List; @Validated @RestController @RequestMapping({"/api/v1", "/api"}) public class AgreementContentController { private final AgreementContentAppService agreementContentAppService; public AgreementContentController(AgreementContentAppService agreementContentAppService) { this.agreementContentAppService = agreementContentAppService; } @GetMapping("/agreement-contents") public ApiResponse> list() { return ApiResponse.ok(agreementContentAppService.list()); } @PutMapping("/agreement-contents/{agreementType}") public ApiResponse save(@PathVariable("agreementType") String agreementType, @Valid @RequestBody AgreementContentSaveRequest request) { return ApiResponse.ok(agreementContentAppService.save(agreementType, request)); } }