huanghongfa
2021-08-19 c40be027ef8068b9a77bb24c94291dee25f563d8
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
@@ -3,6 +3,7 @@
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.community.ComActEasyPhotoCommentDTO;
import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO;
@@ -11,12 +12,7 @@
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.community.*;
import com.panzhihua.common.model.vos.user.NoticeUnReadVO;
import com.panzhihua.common.model.vos.user.SysUserAgreementVO;
import com.panzhihua.common.model.vos.user.SysUserNoticeVO;
@@ -53,13 +49,11 @@
    @ApiOperation(value = "分页展示社区随手拍",response = ComActEasyPhotoVO.class)
    @PostMapping("pageeasyphoto")
    public R pageEasyPhoto (@RequestBody ComActEasyPhotoVO comActEasyPhotoVO){
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null==communityId||0==communityId) {
            return R.fail("用户未绑定社区");
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if(loginUserInfo != null){
            comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId());
            comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId());
        }
        comActEasyPhotoVO.setCommunityId(communityId);
        comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId());
        return communityService.pageEasyPhotoApplets(comActEasyPhotoVO);
    }
@@ -83,18 +77,38 @@
        return communityService.addEasyPhoto(comActEasyPhotoVO);
    }
    @ApiOperation(value = "查询随手拍是否有活动",response = ComActEasyPhotoActivityVO.class)
    @PostMapping("getEasyPhotoActivity")
    public R getEasyPhotoActivity (@RequestBody CommonDTO commonDTO){
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        Long communityId = commonDTO.getCommunityId();
        if(loginUserInfo != null){
            communityId = loginUserInfo.getCommunityId();
        }
        return communityService.getEasyPhotoActivity(communityId);
    }
    @ApiOperation(value = "随手拍详情",response =ComActEasyPhotoVO.class )
    @GetMapping("detaileasyphoto")
    @ApiImplicitParam(name = "id",value = "随手拍主键")
    public R detailEasyPhoto (@RequestParam("id") Long id){
        Long userId = this.getUserId();
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if(loginUserInfo != null){
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailEasyPhoto(id,userId);
    }
    @ApiOperation(value = "随手拍--评论--分页查询",response = ComActEasyPhotoCommentVO.class )
    @PostMapping("pagecomacteasyphotocomment")
    public R pageComActEasyPhotoComment (@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO){
        pageComActEasyPhotoCommentDTO.setUserId(this.getUserId());
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if(loginUserInfo != null){
            userId = loginUserInfo.getUserId();
        }
        pageComActEasyPhotoCommentDTO.setUserId(userId);
        return communityService.pageComActEasyPhotoComment(pageComActEasyPhotoCommentDTO);
    }
@@ -132,15 +146,12 @@
    @ApiOperation(value = "分页展示社区微心愿",response = ComActMicroWishVO.class)
    @PostMapping("pagemicrowish")
    public R pageMicroWish (@RequestBody ComActMicroWishVO comActMicroWishVO){
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null==communityId||0==communityId) {
            return R.fail("用户未绑定社区");
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if(loginUserInfo != null){
            comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId());
            comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());//责任人暂时放登录用户id
        }
        Long userId = loginUserInfo.getUserId();
        comActMicroWishVO.setCommunityId(communityId);
        comActMicroWishVO.setIsApplets(1);
        comActMicroWishVO.setResponsibleId(userId);//责任人暂时放登录用户id
        comActMicroWishVO.setIsPageMyWish(null);
        return communityService.pageMicroWish(comActMicroWishVO);
    }
@@ -174,7 +185,11 @@
    @GetMapping("microwish")
    @ApiImplicitParam(name = "id",value = "微心愿主键")
    public R detailMicroWish (@RequestParam("id")Long id){
        Long userId = this.getUserId();
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if(loginUserInfo != null){
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailMicroWish(id,userId);
    }
@@ -191,7 +206,7 @@
    }
    @ApiOperation(value = "首页广告banner",response = ComOpsAdvVO.class)
    @GetMapping("listadvertisement")
    @GetMapping("listadvertisement/noToken")
    public R listAdvertisement (){
        return communityService.listAdvertisement();
    }
@@ -249,7 +264,6 @@
        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);
@@ -326,4 +340,22 @@
    public R isShop(){
        return R.ok(Constants.IS_SHOP_OPEN);
    }
    @ApiOperation(value = "获取最新活动和用户最新收益",response =ComActEasyPhotoRewardVO.class )
    @GetMapping("getUserReward")
    public R getUserReward(@RequestParam("communityId") Long communityId){
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if(loginUserInfo != null){
            userId = loginUserInfo.getUserId();
            communityId = loginUserInfo.getCommunityId();
        }
        return communityService.getUserReward(userId,communityId);
    }
    @ApiOperation(value = "读取用户随手拍奖励")
    @PostMapping("readUserReward")
    public R readUserReward(){
        return communityService.readUserReward(this.getUserId(),this.getCommunityId());
    }
}