| | |
| | | package com.xinquan.meditation.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xinquan.common.core.utils.page.BeanUtils; |
| | | import com.xinquan.meditation.domain.MeditationCategory; |
| | | import com.xinquan.meditation.domain.vo.ClientMeditationCategoryVO; |
| | | import com.xinquan.meditation.mapper.MeditationCategoryMapper; |
| | | import com.xinquan.meditation.service.MeditationCategoryService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import java.util.List; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class MeditationCategoryServiceImpl extends ServiceImpl<MeditationCategoryMapper, MeditationCategory> implements MeditationCategoryService { |
| | | |
| | | /** |
| | | * 获取冥想分类列表 |
| | | * |
| | | * @param type 分类类型 |
| | | * @return 分类列表 |
| | | */ |
| | | @Override |
| | | public List<ClientMeditationCategoryVO> getCategoryListByType(Integer type) { |
| | | List<MeditationCategory> list = this.lambdaQuery() |
| | | .orderByDesc(MeditationCategory::getSortNum).last(type == 1, "limit 4") |
| | | .last(type == 2, "limit 4,3").list(); |
| | | return BeanUtils.copyList(list, ClientMeditationCategoryVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取冥想分类列表 |
| | | * |
| | | * @return 冥想分类列表 |
| | | */ |
| | | @Override |
| | | public List<ClientMeditationCategoryVO> getCategoryList() { |
| | | List<MeditationCategory> list = this.lambdaQuery() |
| | | .orderByDesc(MeditationCategory::getSortNum).list(); |
| | | return BeanUtils.copyList(list, ClientMeditationCategoryVO.class); |
| | | } |
| | | } |