| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | 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.dtos.community.PageComActDTO; |
| | |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询平台所有的社区 |
| | | * |
| | | * @return 社区集合 按照创建顺序倒序排列 |
| | | */ |
| | | @Override |
| | | public R listCommunityAll() { |
| | | List<ComActDO> comActDOS = comActDAO.selectList(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getState, 0).orderByDesc(ComActDO::getCreateAt)); |
| | | List<ComActVO> comActVOS=new ArrayList<>(); |
| | | if (!ObjectUtils.isEmpty(comActDOS)) { |
| | | comActDOS.forEach(comActDO -> { |
| | | ComActVO comActVO=new ComActVO(); |
| | | BeanUtils.copyProperties(comActDO,comActVO); |
| | | comActVOS.add(comActVO); |
| | | }); |
| | | } |
| | | return R.ok(comActVOS); |
| | | } |
| | | |
| | | |
| | | } |