From b3c6911c1e78563dc04998dd7bfb510130a9fcec Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期一, 01 二月 2021 16:37:52 +0800 Subject: [PATCH] auth --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java | 81 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 76 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 b5e79e9..8c55dba 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,12 +1,24 @@ package com.panzhihua.applets.api; 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.ComActMicroWishVO; +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; 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; @@ -28,6 +40,8 @@ public class IndexApi extends BaseController { @Resource private CommunityService communityService; + @Resource + private UserService userService; @ApiOperation(value = "分页展示社区随手拍",response = ComActEasyPhotoVO.class) @PostMapping("pageeasyphoto") @@ -37,11 +51,9 @@ 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("上传随手拍") @@ -65,6 +77,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("点赞/取消点赞随手拍") @@ -96,6 +129,7 @@ comActMicroWishVO.setCommunityId(communityId); comActMicroWishVO.setIsApplets(1); comActMicroWishVO.setResponsibleId(userId);//责任人暂时放登录用户id + comActMicroWishVO.setIsPageMyWish(null); return communityService.pageMicroWish(comActMicroWishVO); } @@ -110,7 +144,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); @@ -138,4 +173,40 @@ return communityService.putMicroWish(comActMicroWishVO); } + @ApiOperation(value = "首页广告banner",response = ComOpsAdvVO.class) + @GetMapping("listadvertisement") + public R listAdvertisement (){ + return communityService.listAdvertisement(); + } + + @ApiOperation(value = "分页通知列表",response = SysUserNoticeVO.class) + @PostMapping("pagenotice") + public R pageNotice (@RequestBody @Validated(PageGroup.class) PageDTO pageDTO){ + Long userId = this.getUserId(); + pageDTO.setUserId(userId); + return userService.pageNotice(pageDTO); + } + + @ApiOperation(value = "通知已读") + @PutMapping("notice") + public R putNotice (@RequestBody NoticeReadDTO noticeReadDTO){ + Long userId = this.getUserId(); + noticeReadDTO.setUserId(userId); + return userService.putNotice(noticeReadDTO); + } + + @ApiOperation(value = "未读消息汇总",response = NoticeUnReadVO.class) + @GetMapping("noticeunreadnum") + public R noticeUnreadNum (){ + Long userId = this.getUserId(); + 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); + } + } -- Gitblit v1.7.1