huanghongfa
2021-07-24 08b805a0564593a85939b8dc1a9e26497967013d
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -378,12 +378,12 @@
        Long id = comActDynVO.getId();
        BeanUtils.copyProperties(comActDynVO, comActDynDO);
        Integer isTopping = comActDynVO.getIsTopping();
        boolean b = isTopping.intValue() == 1;
        boolean b = isTopping.equals(1);
        if(b){
            ComActDynDO comActDynDO1 = comActDynService.getById(id);
            Integer status = comActDynDO1.getStatus();
            if (status.intValue()==0) {
                return R.fail("该动态还未发布");
            if (status.equals(0)) {
                return R.fail("待发布的社区动态不可置顶");
            }
        }
        boolean update = comActDynService.updateById(comActDynDO);
@@ -1751,4 +1751,35 @@
    public R getCommunityLists(){
        return comActService.getCommunityLists();
    }
    /**
     * 随手拍发放奖励
     * @param grantRewardDTO    请求参数
     * @return  发放结果
     */
    @PostMapping("/easyphoto/grantReward")
    public R grantReward(@RequestBody GrantRewardDTO grantRewardDTO) {
        return comActEasyPhotoService.grantReward(grantRewardDTO);
    }
    /**
     * 获取最新活动和用户最新收益
     * @param userId    用户id
     * @param communityId   社区id
     * @return  最新活动和用户最新收益
     */
    @PostMapping("easyphoto/getUserReward")
    public R getUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId) {
        return comActEasyPhotoService.getUserReward(userId,communityId);
    }
    /**
     * 读取用户随手拍奖励
     * @param userId    用户id
     * @return  读取结果
     */
    @PostMapping("easyphoto/readUserReward")
    public R readUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId) {
        return comActEasyPhotoService.readUserReward(userId,communityId);
    }
}