package com.autovoucher.web; import com.autovoucher.dto.LineFeedbackRequest; import com.autovoucher.service.LineFeedbackService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Map; @RestController @RequestMapping("/api/vouchers/{voucherId}/lines/{lineNo}/feedback") public class LineFeedbackController { private final LineFeedbackService lineFeedbackService; public LineFeedbackController(LineFeedbackService lineFeedbackService) { this.lineFeedbackService = lineFeedbackService; } @GetMapping("/context") public Map context(@PathVariable Long voucherId, @PathVariable Integer lineNo, @RequestParam(required = false) Integer sourceLineNo) { return lineFeedbackService.context(voucherId, lineNo, sourceLineNo); } @PostMapping("/test") public Map test(@PathVariable Long voucherId, @PathVariable Integer lineNo, @RequestBody LineFeedbackRequest request) { return lineFeedbackService.test(voucherId, lineNo, request); } @PostMapping("/apply") public Map apply(@PathVariable Long voucherId, @PathVariable Integer lineNo, @RequestBody LineFeedbackRequest request) { return lineFeedbackService.apply(voucherId, lineNo, request); } }