Commit 40d0e1ee by 段启岩

PostApi /my/post,验证参数

parent ff00ccaa
......@@ -132,7 +132,10 @@ public class PostApi {
*/
@ApiOperation("我的动态列表")
@GetMapping("/my/posts")
public Response<PageVO<Post>> getMyPosts (@Valid PageForm pageForm , @CurrentSubject Subject subject) {
public Response<?> getMyPosts (@Valid PageForm pageForm , BindingResult bindingResult, @CurrentSubject Subject subject) {
if (bindingResult.hasErrors()) {
return Response.fieldError(bindingResult.getFieldError());
}
IPage<Post> postPage = postService.getUserPostPage(pageForm.getPage(), pageForm.getSize(), (String) subject.getId());
PageVO<Post> postPageVO = new PageVO<>(postPage);
return Response.success(postPageVO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment