You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

45 lines
1.8 KiB

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<String, Object> context(@PathVariable Long voucherId,
@PathVariable Integer lineNo,
@RequestParam(required = false) Integer sourceLineNo) {
return lineFeedbackService.context(voucherId, lineNo, sourceLineNo);
}
@PostMapping("/test")
public Map<String, Object> test(@PathVariable Long voucherId,
@PathVariable Integer lineNo,
@RequestBody LineFeedbackRequest request) {
return lineFeedbackService.test(voucherId, lineNo, request);
}
@PostMapping("/apply")
public Map<String, Object> apply(@PathVariable Long voucherId,
@PathVariable Integer lineNo,
@RequestBody LineFeedbackRequest request) {
return lineFeedbackService.apply(voucherId, lineNo, request);
}
}