| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.EditComActEasyPhotoHandlerDto; |
| | | import com.panzhihua.common.model.dtos.common.EvaluateEasyDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComActEasyPhotoHandlerDto; |
| | | import com.panzhihua.common.model.vos.common.ComActEasyPhotoHandlerVo; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.BannerVO; |
| | | import com.panzhihua.common.service.community.ComActEasyPhotoEvaluateFeign; |
| | | import com.panzhihua.common.service.community.ComActEasyPhotoHandlerFeign; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.CommonDTO; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.common.EditComActEasyPhotoHandlerDto; |
| | | import com.panzhihua.common.model.dtos.common.EvaluateEasyDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComActEasyPhotoHandlerDto; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.advertisement.ComOpsAdvVO; |
| | | import com.panzhihua.common.model.vos.common.ComActEasyPhotoHandlerVo; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.BannerVO; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoClassifyVO; |
| | | import com.panzhihua.common.model.vos.user.NoticeUnReadVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserAgreementVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.ComActEasyPhotoEvaluateFeign; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | 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; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | @PostMapping("easyphoto") |
| | | public R addEasyPhoto(@RequestBody @Validated(AddGroup.class) ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | // 微信内容审核 |
| | | String msg = comActEasyPhotoVO.getDetail(); |
| | | if (!checkService.checkMessage(msg)) { |
| | | return R.fail("内容违规"); |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String detail = comActEasyPhotoVO.getDetail(); |
| | | if (StrUtil.isNotBlank(detail)) { |
| | | String result = checkService.checkMessageBy(detail, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail("填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | |
| | | //微信图片审核 |
| | | String photoPathList = comActEasyPhotoVO.getPhotoPathList(); |
| | | if (StrUtil.isNotBlank(photoPathList)) { |
| | | if (!checkService.checkImageBy(photoPathList, appId)) { |
| | | return R.fail("上传图片存在违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | |
| | | comActEasyPhotoHandler.setUserId(this.getUserId()); |
| | | return this.communityService.queryEasyPhotoHandler(comActEasyPhotoHandler); |
| | | } |
| | | |
| | | /** |
| | | * description edit 编辑数据 |
| | | * |
| | |
| | | @ApiOperation(value = "随手拍--评论--新增评论") |
| | | @PostMapping("comacteasyphotocomment") |
| | | public R addComActEasyPhotoComment(@RequestBody ComActEasyPhotoCommentDTO comActEasyPhotoCommentDTO) { |
| | | // 微信内容审核 |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String comment = comActEasyPhotoCommentDTO.getComment(); |
| | | if (StrUtil.isNotBlank(comment)) { |
| | | String result = checkService.checkMessageBy(comment, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail("填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | comActEasyPhotoCommentDTO.setUserId(this.getUserId()); |
| | | return communityService.addComActEasyPhotoComment(comActEasyPhotoCommentDTO); |
| | | } |