| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.service_community.dao.ComActMicroWishDAO; |
| | | import com.panzhihua.service_community.dao.ComActMicroWishUserDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishDO; |
| | |
| | | } else { |
| | | comActMicroWishVO1.setHaveGiveThumbsUp(1); |
| | | } |
| | | comActMicroWishVO1.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO1.getSponsorPhone())); |
| | | |
| | | }); |
| | | iPage.setRecords(records); |
| | | } |
| | |
| | | @Override |
| | | public R detailMicroWish(Long id, Long userId) { |
| | | ComActMicroWishVO comActMicroWishVO = comActMicroWishDAO.detailMicroWish(id); |
| | | if (ObjectUtils.isEmpty(comActMicroWishVO)) { |
| | | return R.fail("微心愿不存在"); |
| | | } |
| | | Integer starNum = comActMicroWishVO.getStarNum(); |
| | | if (null==starNum) { |
| | | comActMicroWishVO.setStarNum(0); |
| | |
| | | }else { |
| | | comActMicroWishVO.setHaveGiveThumbsUp(1); |
| | | } |
| | | comActMicroWishVO.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO.getSponsorPhone())); |
| | | return R.ok(comActMicroWishVO); |
| | | } |
| | | |
| | |
| | | return todoEventsVOS; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R deleteMicroWish(Long id) { |
| | | ComActMicroWishDO comActMicroWishDO = comActMicroWishDAO.selectById(id); |
| | | if(comActMicroWishDO==null){ |
| | | return R.fail("id有误!"); |
| | | } |
| | | comActMicroWishDAO.deleteById(id); |
| | | comActMicroWishUserDAO.delete(new LambdaQueryWrapper<ComActMicroWishUserDO>().eq(ComActMicroWishUserDO::getMicroWishId,id)); |
| | | return R.ok(); |
| | | } |
| | | } |