| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.study.domain.TStory; |
| | | import com.ruoyi.study.domain.TStoryListen; |
| | | import com.ruoyi.study.dto.SubjectQuery; |
| | | import com.ruoyi.study.mapper.TStoryMapper; |
| | | import com.ruoyi.study.service.ITStoryService; |
| | | import com.ruoyi.study.vo.SubjectVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public List<SubjectVO> listAll(SubjectQuery query) { |
| | | return this.baseMapper.listAll(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<TStory> lookPictureDbu(TStoryListen storyListen, int type) { |
| | | List<TStory> storyList = new ArrayList<>(); |
| | | List<String> list; |
| | | // 分类 |
| | | if (0 == type) { |
| | | list = Arrays.stream(storyListen.getLookStory().split(",")).collect(Collectors.toList()); |
| | | } else { |
| | | list = Arrays.stream(storyListen.getStory().split(",")).collect(Collectors.toList()); |
| | | } |
| | | // 获取图片及语音集合 |
| | | for (String s : list) { |
| | | TStory story = this.lambdaQuery().eq(TStory::getId, s).eq(TStory::getDisabled, 0).one(); |
| | | storyList.add(story); |
| | | } |
| | | return storyList; |
| | | } |
| | | } |