看公司的项目 controller层里方法的返回值全都是ReponseEntity
这是干什么用的?
@RequestMapping(value = "/getLeaderPosts", method = RequestMethod.POST)
@ResponseBody
public ResponseEntity<List<PostsDTO>> getLeaderPosts(@CurrentUserState UserState userState,@RequestBody PageInfo pageInfo, @RequestBody(required = false) PostsDTO dto) {
ResponseEntity<List<PostsDTO>> retRes = new ResponseEntity<List<PostsDTO>>();
PageBounds pageBounds = new PageBounds(pageInfo.getPage(), pageInfo.getPageSize());
dto.setCreateUserId(userState.getUserId());
retRes.setEntity(postsService.getLeaderPosts(dto, pageBounds));
return retRes;
}