| | |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | String address = comActDiscussDTO.getAddress(); |
| | | if (ObjectUtils.isEmpty(address)) { |
| | | return R.fail("地址不能为空"); |
| | | }else if(address.contains("null")){ |
| | | comActDiscussDTO.setAddress(null); |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | |
| | | @ApiOperation(value = "一起议-分页查询",response = ComActDiscussVO.class) |
| | | @PostMapping("pagediscuss") |
| | | public R pageDiscuss(@RequestBody PageComActDiscussDTO pageComActDiscussDTO) { |
| | | pageComActDiscussDTO.setCommunityId(this.getCommunityId()); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | pageComActDiscussDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | Integer isMy = pageComActDiscussDTO.getIsMy(); |
| | | if (null!=isMy&&isMy.intValue()==1) { |
| | | pageComActDiscussDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | pageComActDiscussDTO.setLoginUserId(loginUserInfo.getUserId()); |
| | | return communityService.pageDiscussApplets(pageComActDiscussDTO); |
| | | } |
| | | |
| | |
| | | return communityService.putDiscussUser(comActDiscussUserDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-评论-点赞、取消点赞") |
| | | @PutMapping("discusscommentuser") |
| | | public R putDiscussCommentUser(@RequestBody @Validated ComActDiscussCommentUserDTO comActDiscussUserDTO) { |
| | | comActDiscussUserDTO.setUserId(this.getUserId()); |
| | | return communityService.putDiscussCommentUser(comActDiscussUserDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-详情",response = ComActDiscussVO.class) |
| | | @GetMapping("discuss") |
| | | @ApiImplicitParam(name = "id",value = "一起议主键",required = true) |
| | | public R detailDiscuss(@RequestParam("id") Long id) { |
| | | return communityService.detailDiscussApplets(id); |
| | | Long userId = this.getUserId(); |
| | | return communityService.detailDiscussApplets(id,userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-评论-分页查询",response = ComActDiscussCommentVO.class) |
| | |
| | | if (null==id||0==id) { |
| | | return R.fail("一起议主键不能为空"); |
| | | } |
| | | pageComActDiscussCommentDTO.setLoginUserId(this.getUserId()); |
| | | return communityService.pageDiscussCommentApplets(pageComActDiscussCommentDTO); |
| | | } |
| | | |
| | |
| | | return communityService.addDiscussCommentBack(comActDiscussCommentDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-投票") |
| | | @GetMapping("discussoptionuser") |
| | | @ApiImplicitParam(name = "id",value = "一起议选项主键",required = true) |
| | | public R addDiscussOptionUser(@RequestParam("id") Long id) { |
| | | if (null==id||0==id) { |
| | | return R.fail("选项主键不能为空"); |
| | | } |
| | | ComActDiscussOptionUserDTO comActDiscussOptionUserDTO=new ComActDiscussOptionUserDTO(); |
| | | comActDiscussOptionUserDTO.setDiscussOptionId(id); |
| | | comActDiscussOptionUserDTO.setUserId(this.getUserId()); |
| | | return communityService.addDiscussOptionUser(comActDiscussOptionUserDTO); |
| | | } |
| | | |
| | | |
| | | |
| | | |