| | |
| | | * @return 详情 |
| | | */ |
| | | @PostMapping("detailactivity") |
| | | public R detailActivity(@RequestParam("id") Long id, @RequestParam("userId") Long userId) { |
| | | public R detailActivity(@RequestParam("id") Long id, @RequestParam(value = "userId",required = false) Long userId) { |
| | | ComActActivityVO comActActivityVO = comActActivityService.inforActivity(id, userId); |
| | | if (ObjectUtils.isEmpty(comActActivityVO)) { |
| | | return R.fail("活动不存在"); |
| | |
| | | */ |
| | | @PostMapping("putdynamic") |
| | | public R putDynamic(@RequestBody ComActDynVO comActDynVO) { |
| | | ComActDynDO comActDynDO = new ComActDynDO(); |
| | | Long id = comActDynVO.getId(); |
| | | BeanUtils.copyProperties(comActDynVO, comActDynDO); |
| | | ComActDynDO comActDynDO = comActDynService.getById(comActDynVO.getId()); |
| | | if(comActDynDO == null){ |
| | | return R.fail("未查到社区动态记录"); |
| | | } |
| | | // Long id = comActDynVO.getId(); |
| | | Integer isTopping = comActDynVO.getIsTopping(); |
| | | boolean b = isTopping.equals(1); |
| | | if(b){ |
| | | ComActDynDO comActDynDO1 = comActDynService.getById(id); |
| | | Integer status = comActDynDO1.getStatus(); |
| | | Integer status = comActDynDO.getStatus(); |
| | | if (status.equals(0)) { |
| | | return R.fail("待发布的社区动态不可置顶"); |
| | | } |
| | | } |
| | | |
| | | // if(StringUtils.isEmpty(comActDynVO.getCover())){ |
| | | // comActDynVO.setCover(comActDynDO.getCover()); |
| | | // } |
| | | BeanUtils.copyProperties(comActDynVO, comActDynDO); |
| | | |
| | | boolean update = comActDynService.updateById(comActDynDO); |
| | | if (update) { |
| | | // 最多只能设置三条置顶状态,后边设置会取消先前设置的置顶 |
| | |
| | | public R readUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId) { |
| | | return comActEasyPhotoService.readUserReward(userId,communityId); |
| | | } |
| | | |
| | | |
| | | } |