From b30e1a48f2bc5f65a0efd2e69e090fed2d7a627c Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期四, 17 十一月 2022 15:56:43 +0800
Subject: [PATCH] #feat 订单退款和查询

---
 springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java |   87 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 78 insertions(+), 9 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
index 9194887..246e70b 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
@@ -68,6 +68,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 +91,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 +99,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 +172,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 +196,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 +219,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());
@@ -227,13 +262,29 @@
         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());
+            comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());// 责任人暂时放登录用户id
+        }
+        comActMicroWishVO.setIsApplets(1);
+        comActMicroWishVO.setIsPageMyWish(null);
+        return communityService.pageMicroWishAppletsDesensitize(comActMicroWishVO);
+    }
+
     @ApiOperation("发布微心愿")
     @PostMapping("microwish")
     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 +313,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 +380,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 +410,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();

--
Gitblit v1.7.1