| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; |
| | |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | Long userId = loginUser.getUserId(); |
| | | Long communityId = loginUser.getCommunityId(); |
| | | |
| | | if(userId == null){ |
| | | return R.fail("请重新登录"); |
| | | } |
| | | addNeighborCircleAppDTO.setUserId(userId); |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String releaseContent = addNeighborCircleAppDTO.getReleaseContent(); |
| | | if (StrUtil.isNotBlank(releaseContent)) { |
| | | String result = checkService.checkMessageBy(releaseContent, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail("填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | |
| | | //微信图片审核 |
| | | String releaseImages = addNeighborCircleAppDTO.getReleaseImages(); |
| | | if (StrUtil.isNotBlank(releaseImages)) { |
| | | if (!checkService.checkImageBy(releaseImages, appId)) { |
| | | return R.fail("上传图片存在违规信息"); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(loginUser.getPhone())) { |
| | | addNeighborCircleAppDTO.setPhone(this.getLoginUserInfo().getPhone()); |
| | | } |
| | |
| | | return R.fail("请先登录"); |
| | | } |
| | | commentAppDTO.setUserId(userId); |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String content = commentAppDTO.getContent(); |
| | | if (StrUtil.isNotBlank(content)) { |
| | | String result = checkService.checkMessageBy(content, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail("填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | return communityWestService.neighborCommentByApp(commentAppDTO); |
| | | } |
| | | |