From 3ca7f722f25c1908bc4588c75dbde1f56a8d9877 Mon Sep 17 00:00:00 2001 From: DESKTOP-71BH0QO\L、ming <172680469@qq.com> Date: 星期五, 26 三月 2021 10:08:46 +0800 Subject: [PATCH] Merge branch 'master' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java | 153 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 148 insertions(+), 5 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 e2e724e..b1a147d 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 @@ -1,14 +1,23 @@ package com.panzhihua.applets.api; +import com.panzhihua.applets.weixin.CheckService; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.PageDTO; +import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; +import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; +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.community.ComActEasyPhotoCommentVO; import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; +import com.panzhihua.common.model.vos.community.ComActMessageBackVO; +import com.panzhihua.common.model.vos.community.ComActMessageVO; import com.panzhihua.common.model.vos.community.ComActMicroWishVO; +import com.panzhihua.common.model.vos.community.PageComActMessageVO; 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.CommunityService; import com.panzhihua.common.service.user.UserService; @@ -37,6 +46,8 @@ private CommunityService communityService; @Resource private UserService userService; + @Resource + private CheckService checkService; @ApiOperation(value = "分页展示社区随手拍",response = ComActEasyPhotoVO.class) @PostMapping("pageeasyphoto") @@ -46,16 +57,19 @@ if (null==communityId||0==communityId) { return R.fail("用户未绑定社区"); } - Long userId = loginUserInfo.getUserId(); comActEasyPhotoVO.setCommunityId(communityId); - comActEasyPhotoVO.setStatus(4); - comActEasyPhotoVO.setLogInUserId(userId); - return communityService.pageEasyPhoto(comActEasyPhotoVO); + comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId()); + return communityService.pageEasyPhotoApplets(comActEasyPhotoVO); } @ApiOperation("上传随手拍") @PostMapping("easyphoto") public R addEasyPhoto (@RequestBody @Validated(AddGroup.class) ComActEasyPhotoVO comActEasyPhotoVO){ + // 微信内容审核 + String msg = comActEasyPhotoVO.getDetail(); + if (!checkService.checkMessage(msg)) { + return R.fail("内容违规"); + } LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); Long communityId = loginUserInfo.getCommunityId(); if (null==communityId||0==communityId) { @@ -74,6 +88,27 @@ public R detailEasyPhoto (@RequestParam("id") Long id){ Long userId = this.getUserId(); return communityService.detailEasyPhoto(id,userId); + } + + @ApiOperation(value = "随手拍--评论--分页查询",response = ComActEasyPhotoCommentVO.class ) + @PostMapping("pagecomacteasyphotocomment") + public R pageComActEasyPhotoComment (@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO){ + pageComActEasyPhotoCommentDTO.setUserId(this.getUserId()); + return communityService.pageComActEasyPhotoComment(pageComActEasyPhotoCommentDTO); + } + + @ApiOperation(value = "随手拍--评论--新增评论") + @PostMapping("comacteasyphotocomment") + public R addComActEasyPhotoComment (@RequestBody ComActEasyPhotoCommentDTO comActEasyPhotoCommentDTO){ + comActEasyPhotoCommentDTO.setUserId(this.getUserId()); + return communityService.addComActEasyPhotoComment(comActEasyPhotoCommentDTO); + } + + @ApiOperation(value = "随手拍--评论--点赞/取消点赞" ) + @PostMapping("commentsign") + public R commentSign (@RequestBody ComActEasyPhotoCommentUserDTO comActEasyPhotoCommentUserDTO){ + comActEasyPhotoCommentUserDTO.setUserId(this.getUserId()); + return communityService.commentSign(comActEasyPhotoCommentUserDTO); } @ApiOperation("点赞/取消点赞随手拍") @@ -105,12 +140,18 @@ comActMicroWishVO.setCommunityId(communityId); comActMicroWishVO.setIsApplets(1); comActMicroWishVO.setResponsibleId(userId);//责任人暂时放登录用户id + comActMicroWishVO.setIsPageMyWish(null); return communityService.pageMicroWish(comActMicroWishVO); } @ApiOperation("发布微心愿") @PostMapping("microwish") public R addMicroWish (@RequestBody @Validated(AddGroup.class) ComActMicroWishVO comActMicroWishVO){ + // 微信内容审核 + String msg = comActMicroWishVO.getDetail(); + if (!checkService.checkMessage(msg)) { + return R.fail("内容违规"); + } LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); Long communityId = loginUserInfo.getCommunityId(); if (null==communityId||0==communityId) { @@ -119,7 +160,8 @@ Long userId = loginUserInfo.getUserId(); String phone = loginUserInfo.getPhone(); if (ObjectUtils.isEmpty(phone)) { - return R.fail("只有认证后的用户才能发布微心愿"); +// return R.fail("用户绑定手机号后才能发布微心愿"); + phone="18228784579"; } comActMicroWishVO.setSponsorPhone(phone); comActMicroWishVO.setCommunityId(communityId); @@ -176,4 +218,105 @@ return userService.noticeUnreadNum(userId); } + @ApiOperation(value = "获取各种协议",response = SysUserAgreementVO.class) + @GetMapping("agreement") + @ApiImplicitParam(name = "type",value = "1居民端app协议 2网格员端app协议 3商家端app协议 4隐私政策") + public R agreement (@RequestParam("type")Integer type){ + return userService.agreement(type); + } + + + @ApiOperation("发布留言") + @PostMapping("addmessage") + public R addMessage(@RequestBody @Validated(AddGroup.class) ComActMessageVO comActMessageVO){ + // 微信内容审核 + String msg = comActMessageVO.getMsgContent(); + if (!checkService.checkMessage(msg)) { + return R.fail("内容违规"); + } + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + Long communityId = loginUserInfo.getCommunityId(); + if (null==communityId||0==communityId) { + return R.fail("用户未绑定社区"); + } + Integer type = loginUserInfo.getType(); + if(null==type||(type!=1&&type!=2)) { + return R.fail("留言对象类型错误!"); + } + Long userId = loginUserInfo.getUserId(); + comActMessageVO.setCommunityId(communityId); + comActMessageVO.setUserId(userId); + comActMessageVO.setUserName(loginUserInfo.getName()); + comActMessageVO.setUserAccount(loginUserInfo.getAccount()); + comActMessageVO.setUserPhone(loginUserInfo.getPhone()); + comActMessageVO.setIspublic(1); + comActMessageVO.setStatus(1); + return communityService.addMessage(comActMessageVO); + } + + @ApiOperation("发布留言回复") + @PostMapping("addmessageback") + public R addMessageBack(@RequestBody @Validated(AddGroup.class) ComActMessageBackVO comActMessageBackVO){ + // 微信内容审核 + String msg = comActMessageBackVO.getMsgContent(); + if (!checkService.checkMessage(msg)) { + return R.fail("内容违规"); + } + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + Long communityId = loginUserInfo.getCommunityId(); + if (null==communityId||0==communityId) { + return R.fail("用户未绑定社区"); + } + Integer type = loginUserInfo.getType(); + if(null==type||(type!=1&&type!=2)) { + return R.fail("留言对象类型错误!"); + } + Long userId = loginUserInfo.getUserId(); + comActMessageBackVO.setCommunityId(communityId); + comActMessageBackVO.setUserId(userId); + comActMessageBackVO.setUserName(loginUserInfo.getName()); + comActMessageBackVO.setUserAccount(loginUserInfo.getAccount()); + comActMessageBackVO.setIspublic(1); + comActMessageBackVO.setStatus(1); + return communityService.addMessageBack(comActMessageBackVO); + } + + @ApiOperation(value = "分页显示我的留言",response = ComActMessageVO.class) + @PostMapping("pagemymessage") + public R pageMyMessage (@RequestBody ComActMessageVO comActMessageVO){ + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + Long communityId = loginUserInfo.getCommunityId(); + if (null==communityId||0==communityId) { + return R.fail("用户未绑定社区"); + } + comActMessageVO.setCommunityId(communityId); + comActMessageVO.setUserId(loginUserInfo.getUserId()); + return communityService.pageMyMessageApplets(comActMessageVO); + } + + @ApiOperation(value = "分页显示居民给我的留言",response = ComActMessageVO.class) + @PostMapping("pagesendtomemessage") + public R pageSendToMessage (@RequestBody ComActMessageVO comActMessageVO){ + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + Long communityId = loginUserInfo.getCommunityId(); + if (null==communityId||0==communityId) { + return R.fail("用户未绑定社区"); + } + comActMessageVO.setCommunityId(communityId); + comActMessageVO.setUserId(loginUserInfo.getUserId()); + comActMessageVO.setPhone(loginUserInfo.getPhone()); + return communityService.pageSendToMessageApplets(comActMessageVO); + } + @ApiOperation(value = "分页显示指定用户的留言",response =ComActMessageVO.class ) + @PostMapping("pagemessagebyuser") + public R pageMessageByUser (@RequestBody ComActMessageVO comActMessageVO){ + return communityService.pageMessageByUser(comActMessageVO); + } + + @ApiOperation(value = "留言详情",response =ComActMessageVO.class ) + @GetMapping("detailmessage") + @ApiImplicitParam(name = "id",value = "随手拍主键") + public R detailMessage(@RequestParam("id") Long id){ + return communityService.detailMessage(id); + } } -- Gitblit v1.7.1