lidongdong
2023-11-20 e3c72ee83aa8b857d17d0e79a43c89d3c267f9f9
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
@@ -26,6 +26,7 @@
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.utlis.StringUtils;
import com.panzhihua.common.validated.AddGroup;
import com.panzhihua.common.validated.PageGroup;
import io.swagger.annotations.Api;
@@ -68,6 +69,18 @@
        return communityService.pageEasyPhotoApplets(comActEasyPhotoVO);
    }
    @ApiOperation(value = "分页展示社区随手拍-脱敏", response = ComActEasyPhotoVO.class)
    @PostMapping("pageEasyPhotoDesensitize")
    public R pageEasyPhotoDesensitize(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId());
            comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId());
            comActEasyPhotoVO.setIsDpcMember(loginUserInfo.getIsDpcMember());
        }
        return communityService.pageEasyPhotoAppletsDesensitize(comActEasyPhotoVO);
    }
    @ApiOperation("上传随手拍")
    @PostMapping("easyphoto")
    public R addEasyPhoto(@RequestBody @Validated(AddGroup.class) ComActEasyPhotoVO comActEasyPhotoVO) {
@@ -79,7 +92,7 @@
        if (StrUtil.isNotBlank(detail)) {
            String result = checkService.checkMessageBy(detail, openid, appId);
            if (StrUtil.isNotBlank(result)) {
                return R.fail("填写内容存在 " + result + " 违规信息");
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
@@ -87,7 +100,7 @@
        String photoPathList = comActEasyPhotoVO.getPhotoPathList();
        if (StrUtil.isNotBlank(photoPathList)) {
            if (!checkService.checkImageBy(photoPathList, appId)) {
                return R.fail("上传图片存在违规信息");
                return R.fail(501, "上传图片存在违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
@@ -160,6 +173,17 @@
        }
        return communityService.detailEasyPhoto(id, userId);
    }
    @ApiOperation(value = "随手拍详情-脱敏", response = ComActEasyPhotoVO.class)
    @GetMapping("detailEasyPhotoDesensitize")
    @ApiImplicitParam(name = "id", value = "随手拍主键")
    public R detailEasyPhotoDesensitize(@RequestParam("id") Long id) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailEasyPhotoDesensitize(id, userId);
    }
    @ApiOperation(value = "随手拍--评论--分页查询", response = ComActEasyPhotoCommentVO.class)
    @PostMapping("pagecomacteasyphotocomment")
@@ -173,6 +197,18 @@
        return communityService.pageComActEasyPhotoComment(pageComActEasyPhotoCommentDTO);
    }
    @ApiOperation(value = "随手拍--评论--分页查询-脱敏", response = ComActEasyPhotoCommentVO.class)
    @PostMapping("pageComActEasyPhotoCommentDesensitize")
    public R pageComActEasyPhotoCommentDesensitize(@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        pageComActEasyPhotoCommentDTO.setUserId(userId);
        return communityService.pageComActEasyPhotoCommentDesensitize(pageComActEasyPhotoCommentDTO);
    }
    @ApiOperation(value = "随手拍--评论--新增评论")
    @PostMapping("comacteasyphotocomment")
    public R addComActEasyPhotoComment(@RequestBody ComActEasyPhotoCommentDTO comActEasyPhotoCommentDTO) {
@@ -184,7 +220,7 @@
        if (StrUtil.isNotBlank(comment)) {
            String result = checkService.checkMessageBy(comment, openid, appId);
            if (StrUtil.isNotBlank(result)) {
                return R.fail("填写内容存在 " + result + " 违规信息");
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        comActEasyPhotoCommentDTO.setUserId(this.getUserId());
@@ -216,7 +252,26 @@
    @ApiOperation(value = "分页展示社区微心愿", response = ComActMicroWishVO.class)
    @PostMapping("pagemicrowish")
    public R pageMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO) {
    public R pageMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO)
    {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId());
            comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());// 责任人暂时放登录用户id
        }
        if(!StringUtils.isEmpty(comActMicroWishVO.getHandleId()))
        {
            comActMicroWishVO.setCommunityId(null);
        }
        comActMicroWishVO.setIsApplets(1);
        comActMicroWishVO.setIsPageMyWish(null);
        return communityService.pageMicroWishApplets(comActMicroWishVO);
    }
    @ApiOperation(value = "分页展示社区微心愿-脱敏", response = ComActMicroWishVO.class)
    @PostMapping("pageMicroWishDesensitize")
    public R pageMicroWishDesensitize(@RequestBody ComActMicroWishVO comActMicroWishVO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId());
@@ -224,7 +279,7 @@
        }
        comActMicroWishVO.setIsApplets(1);
        comActMicroWishVO.setIsPageMyWish(null);
        return communityService.pageMicroWishApplets(comActMicroWishVO);
        return communityService.pageMicroWishAppletsDesensitize(comActMicroWishVO);
    }
    @ApiOperation("发布微心愿")
@@ -232,8 +287,11 @@
    public R addMicroWish(@RequestBody @Validated(AddGroup.class) ComActMicroWishVO comActMicroWishVO) {
        // 微信内容审核
        String msg = comActMicroWishVO.getDetail();
        if (!checkService.checkMessage(msg)) {
            return R.fail("内容违规");
        if (StrUtil.isNotBlank(msg)) {
            String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
@@ -262,6 +320,18 @@
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailMicroWish(id, userId);
    }
    @ApiOperation(value = "心愿详情-脱敏", response = ComActMicroWishVO.class)
    @GetMapping("microwishDesensitize")
    @ApiImplicitParam(name = "id", value = "微心愿主键")
    public R detailMicroWishDesensitize(@RequestParam("id") Long id) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailMicroWishDesensitize(id, userId);
    }
    @ApiOperation("点赞/取消点赞微心愿")
@@ -317,8 +387,11 @@
    public R addMessage(@RequestBody @Validated(AddGroup.class) ComActMessageVO comActMessageVO) {
        // 微信内容审核
        String msg = comActMessageVO.getMsgContent();
        if (!checkService.checkMessage(msg)) {
            return R.fail("内容违规");
        if (StrUtil.isNotBlank(msg)) {
            String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
@@ -344,8 +417,11 @@
    public R addMessageBack(@RequestBody @Validated(AddGroup.class) ComActMessageBackVO comActMessageBackVO) {
        // 微信内容审核
        String msg = comActMessageBackVO.getMsgContent();
        if (!checkService.checkMessage(msg)) {
            return R.fail("内容违规");
        if (StrUtil.isNotBlank(msg)) {
            String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
@@ -438,6 +514,18 @@
        return communityService.getUserRewards(userId, communityId);
    }
    @ApiOperation(value = "获取普达首页弹窗接口", response = ComActEasyPhotoRewardVO.class)
    @GetMapping("getUserRewardsNew")
    public R getUserRewardsNew(@RequestParam("communityId") Long communityId) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
            communityId = loginUserInfo.getCommunityId();
        }
        return communityService.getUserRewardsNew(userId, communityId);
    }
    @ApiOperation(value = "读取用户随手拍奖励")
    @PostMapping("readUserReward")
    public R readUserReward() {