mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
fix: 增加评论参数校验
This commit is contained in:
parent
747d2c9fc7
commit
339fcf6ddc
@ -137,5 +137,4 @@ public class BookController {
|
|||||||
return bookService.listNewestComments(bookId);
|
return bookService.listNewestComments(bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class UserController {
|
|||||||
* 发表评论接口
|
* 发表评论接口
|
||||||
* */
|
* */
|
||||||
@PostMapping("comment")
|
@PostMapping("comment")
|
||||||
public RestResp<Void> comment(@RequestBody UserCommentReqDto dto) {
|
public RestResp<Void> comment(@Valid @RequestBody UserCommentReqDto dto) {
|
||||||
dto.setUserId(UserHolder.getUserId());
|
dto.setUserId(UserHolder.getUserId());
|
||||||
return bookService.saveComment(dto);
|
return bookService.saveComment(dto);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import com.fasterxml.jackson.databind.SerializerProvider;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名序列化类(敏感信息,不应该在页面上完全显示)
|
* 用户名序列化器(敏感信息,不应该在页面上完全显示)
|
||||||
*
|
*
|
||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/20
|
* @date 2022/5/20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user