| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.dtos.community.PageVolunteerDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PageGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @ApiOperation(value = "报名/取消报名社区活动") |
| | | @PutMapping("signactivity") |
| | | public R signActivity(@RequestBody SignactivityVO signactivityVO){ |
| | | public R signActivity(@RequestBody @Validated(AddGroup.class) SignactivityVO signactivityVO){ |
| | | Long userId = this.getUserId(); |
| | | signactivityVO.setUserId(userId); |
| | | return communityService.signActivity(signactivityVO); |
| | |
| | | |
| | | @ApiOperation(value = "活动人员列表",response = ActivitySignVO.class) |
| | | @ApiImplicitParam(name ="id",value = "社区活动主键",required = true) |
| | | @PostMapping("listactivitysign") |
| | | @GetMapping("listactivitysign") |
| | | public R listActivitySign(@RequestParam("id") Long id){ |
| | | ActivitySignVO activitySignVO=new ActivitySignVO(); |
| | | activitySignVO.setActivityId(id); |
| | |
| | | @PostMapping("dynamicuser") |
| | | public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){ |
| | | Long id = comActDynVO.getId(); |
| | | if (ObjectUtils.isEmpty(id)||id==0) { |
| | | 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); |
| | | return communityService.addVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询志愿者团队") |
| | | @PostMapping("pagevolunteer") |
| | | public R pageVolunteer(@RequestBody @Validated(PageGroup.class) PageVolunteerDTO pageVolunteerDTO){ |
| | | Long communityId = this.getCommunityId(); |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO=new ComMngVolunteerMngVO(); |
| | | comMngVolunteerMngVO.setCommunityId(communityId); |
| | | comMngVolunteerMngVO.setPageNum(pageVolunteerDTO.getPageNum()); |
| | | comMngVolunteerMngVO.setPageSize(pageVolunteerDTO.getPageSize()); |
| | | return communityService.pageVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "志愿者详情",response = ComMngVolunteerMngAppletsVO.class) |
| | | @GetMapping("volunteer") |
| | | public R detailVolunteer(@RequestParam("id") Long id){ |
| | | return communityService.detailVolunteer(id); |
| | | } |
| | | |
| | | |
| | | } |
| | | |