| | |
| | | import com.panzhihua.common.validated.PageGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | @ApiOperation(value = "社区动态详情",response = ComActDynVO.class) |
| | | @GetMapping("detaildynamic") |
| | | @ApiImplicitParam(name ="id",value = "社区动态主键",required = true) |
| | | public R detailDynamic(@RequestParam("id") Long id){//todo 增加微信分享接口 |
| | | return communityService.detailDynamic(id); |
| | | public R detailDynamic(@RequestParam("id") Long id){ |
| | | Long userId = this.getUserId(); |
| | | R r = communityService.detailDynamic(id); |
| | | if (R.isOk(r)) { |
| | | //增加浏览记录 |
| | | communityService.addDynamicUser(id,userId); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询社区活动",response = ComActActivityVO.class) |
| | |
| | | Long communityId = this.getCommunityId(); |
| | | comActActivityVO.setCommunityId(communityId); |
| | | comActActivityVO.setIsApplets(1); |
| | | Integer status = comActActivityVO.getStatus(); |
| | | if (null!=status&&status.intValue()==4) { |
| | | comActActivityVO.setIsIng(1); |
| | | } |
| | | return communityService.pageActivity(comActActivityVO); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "活动人员列表",response = ActivitySignVO.class) |
| | | @ApiImplicitParam(name ="id",value = "社区活动主键",required = true) |
| | | @ApiImplicitParams ({@ApiImplicitParam(name ="type",value = "人员类型 1 普通居民 2 志愿者",required = true), |
| | | @ApiImplicitParam(name ="id",value = "社区活动主键",required = true)}) |
| | | @GetMapping("listactivitysign") |
| | | public R listActivitySign(@RequestParam("id") Long id){ |
| | | public R listActivitySign(@RequestParam("id") Long id,@RequestParam("type") Integer type){ |
| | | ActivitySignVO activitySignVO=new ActivitySignVO(); |
| | | activitySignVO.setActivityId(id); |
| | | if (null==type||0==type||type>2) { |
| | | return R.fail("人员类型错误"); |
| | | } |
| | | activitySignVO.setType(type); |
| | | return communityService.listActivitySign(activitySignVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增社区动态浏览记录") |
| | | @PostMapping("dynamicuser") |
| | | public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){ |
| | | Long id = comActDynVO.getId(); |
| | | if (null==id||id==0) { |
| | | return R.fail("社区动态不存在"); |
| | | } |
| | | Long userId = this.getUserId(); |
| | | return communityService.addDynamicUser(id,userId); |
| | | } |
| | | // @ApiOperation(value = "新增社区动态浏览记录") |
| | | // @PostMapping("dynamicuser") |
| | | // public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){ |
| | | // Long id = comActDynVO.getId(); |
| | | // if (null==id||id==0) { |
| | | // return R.fail("社区动态不存在"); |
| | | // } |
| | | // Long userId = this.getUserId(); |
| | | // return communityService.addDynamicUser(id,userId); |
| | | // } |
| | | |
| | | @ApiOperation(value = "志愿者申请") |
| | | @PostMapping("volunteer") |
| | | public R addVolunteer(@RequestBody @Validated(AddGroup.class) ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | comMngVolunteerMngVO.setState(1); |
| | | comMngVolunteerMngVO.setCommunityId(this.getCommunityId()); |
| | | return communityService.addVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |