标签:tps not code stc advice 状态码 res exist http
@RequestMapping("/test1")
public ResponseEntity<?> testControllerAdvice(String id) {
if (StringUtils.isEmpty(id)) {
throw new UserNotExistException(id);
}
//能设置返回的状态码,和请求头 可以拆解为@ResponseBody和@ResponseStatus
return new ResponseEntity<String>("正常", HttpStatus.BAD_REQUEST);
}
标签:tps not code stc advice 状态码 res exist http
原文地址:https://www.cnblogs.com/kikochz/p/12815265.html