New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.CancelRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveIndexVo; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveDetailVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComOperationDetailVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 预约/登记服务 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("reserve") |
| | | @Api(tags = "预约/登记服务") |
| | | public class ComReserveApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "详情",response = ComActReserveDetailVO.class) |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id,@RequestParam("recordId") Long recordId,@RequestParam("isBack") Integer isBack){ |
| | | return communityService.reserveDetail(id,this.getUserId(),recordId,isBack); |
| | | } |
| | | |
| | | @ApiOperation("用户提交数据") |
| | | @PostMapping("/commit") |
| | | public R commit(@RequestBody ComActReserveCommitVO comActReserveCommitVO){ |
| | | comActReserveCommitVO.setCommunityId(this.getCommunityId()); |
| | | comActReserveCommitVO.setUserId(this.getUserId()); |
| | | return communityService.reserveCommit(comActReserveCommitVO); |
| | | } |
| | | |
| | | /** |
| | | * 我的预约/登记 |
| | | * @param pageUserReserveDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "我的预约/登记",response = ComActReserveAppletsVO.class) |
| | | @PostMapping("/userReserveList") |
| | | public R userReserveList(@RequestBody PageUserReserveDTO pageUserReserveDTO){ |
| | | pageUserReserveDTO.setUserId(this.getUserId()); |
| | | return communityService.userReserveList(pageUserReserveDTO); |
| | | } |
| | | /** |
| | | * 取消预约/登记 |
| | | */ |
| | | @ApiOperation("取消预约/登记") |
| | | @PostMapping("/cancelReserve") |
| | | public R userCancelReserve(@RequestBody CancelRecordDTO cancelRecordDTO){ |
| | | cancelRecordDTO.setUserId(this.getUserId()); |
| | | return communityService.userCancelReserve(cancelRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 预约详情操作记录 |
| | | */ |
| | | @ApiOperation(value = "预约详情操作记录",response = ComOperationDetailVO.class) |
| | | @PostMapping("/detailOperation") |
| | | public R reserveOperation(@RequestBody OperationDetailDTO comActReserveOperationRecordDO){ |
| | | comActReserveOperationRecordDO.setUserId(this.getUserId()); |
| | | return communityService.reserveOperation(comActReserveOperationRecordDO); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约登记列表",response = ComActReserveIndexVo.class) |
| | | @GetMapping("/list") |
| | | public R list(@RequestParam("communityId") Long communityId){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | return communityService.reserveListApplets(communityId); |
| | | } |
| | | } |