| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.ComOpsHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComOpsHouseDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComOpsHouseUndercarriageVO; |
| | | import com.panzhihua.common.model.vos.community.ComOpsHouseVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | |
| | | @ApiOperation(value = "房屋租售-新增") |
| | | @PostMapping("house") |
| | | public R addHouse(@RequestBody @Validated(AddGroup.class) ComOpsHouseDTO comOpsHouseDTO) { |
| | | // 微信内容审核 |
| | | // 微信内容审核 |
| | | String introduction = comOpsHouseDTO.getIntroduction(); |
| | | if (!checkService.checkMessage(introduction)) { |
| | | return R.fail("内容违规"); |
| | | if (StrUtil.isNotBlank(introduction)) { |
| | | String result = checkService.checkMessageBy(introduction, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | |
| | | return communityService.addOpsHouse(comOpsHouseDTO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "房屋租售-分页查询",response = ComOpsHouseVO.class) |
| | | @ApiOperation(value = "房屋租售-分页查询", response = ComOpsHouseVO.class) |
| | | @PostMapping("pagehouse") |
| | | public R pageHouse(@RequestBody PageComOpsHouseDTO pageComOpsHouseDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Integer isMy = pageComOpsHouseDTO.getIsMy(); |
| | | if (null!=isMy&&isMy.intValue()==1) { |
| | | if (null != isMy && isMy.equals(1)) { |
| | | pageComOpsHouseDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityService.pageOpsHouse(pageComOpsHouseDTO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "房屋租售-详情",response = ComOpsHouseVO.class) |
| | | @ApiOperation(value = "房屋租售-详情", response = ComOpsHouseVO.class) |
| | | @GetMapping("house") |
| | | @ApiImplicitParam(name = "id",value = "房屋租售主键",required = true) |
| | | @ApiImplicitParam(name = "id", value = "房屋租售主键", required = true) |
| | | public R detailHouse(@RequestParam("id") Long id) { |
| | | return communityService.detailOpsHouse(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-修改") |
| | | @PostMapping("putHouse") |
| | | public R updateHouse(@RequestBody @Validated(PutGroup.class) ComOpsHouseVO comOpsHouseVO) { |
| | | return communityService.putOpsHouseByApplets(comOpsHouseVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-删除") |
| | | @GetMapping("delHouse") |
| | | @ApiImplicitParam(name = "id", value = "房屋租售主键", required = true) |
| | | public R delHouse(@RequestParam("id") Long id) { |
| | | return communityService.deleteOpsHouse(id); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "房屋租售-上下架") |
| | | @PostMapping("undercarriageHouse") |
| | | public R undercarriageHouse(@RequestBody @Validated(PutGroup.class) ComOpsHouseUndercarriageVO comOpsHouseVO) { |
| | | return communityService.undercarriageHouse(comOpsHouseVO); |
| | | } |
| | | |
| | | } |