|
@@ -9,6 +9,7 @@ import cn.com.jdkj.entity.ResultBean;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -24,26 +25,26 @@ public class CustomerController {
|
|
|
@GetMapping("/login")
|
|
|
@ApiOperation("登入")
|
|
|
@CheckSign
|
|
|
- public ResultBean login(LoginDto dto){
|
|
|
+ public ResultBean login(@Validated LoginDto dto){
|
|
|
return customerService.login(dto);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/register")
|
|
|
@ApiOperation("注册")
|
|
|
@CheckSign
|
|
|
- public ResultBean register(RegisterDto dto){
|
|
|
+ public ResultBean register(@Validated RegisterDto dto){
|
|
|
return customerService.register(dto);
|
|
|
}
|
|
|
@PostMapping("/question")
|
|
|
@ApiOperation("访问问题(返回文本")
|
|
|
@CheckSign
|
|
|
- public ResultBean question(@RequestBody QuestionDto dto){
|
|
|
+ public ResultBean question(@Validated @RequestBody QuestionDto dto){
|
|
|
return customerService.question(dto);
|
|
|
}
|
|
|
@GetMapping("/questionToAudio")
|
|
|
@ApiOperation("访问问题(返回音频流")
|
|
|
@CheckSign
|
|
|
- public void questionToAudio(QuestionDto dto, HttpServletResponse response){
|
|
|
+ public void questionToAudio(@Validated QuestionDto dto, HttpServletResponse response){
|
|
|
customerService.questionToAudio(dto, response);
|
|
|
}
|
|
|
}
|