package com.seer.teach.teacher.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seer.teach.teacher.common.resp.BookChapterAudioResp;
import com.seer.teach.teacher.convert.BookConvert;
import com.seer.teach.teacher.module.entity.BookChapterAudiosEntity;
import com.seer.teach.teacher.module.mapper.BookChapterAudiosMapper;
import com.seer.teach.teacher.service.BookChapterAudiosService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Wang
 * @since 2025-08-03 15:27:10
 */
@Service
public class BookChapterAudiosServiceImpl extends ServiceImpl<BookChapterAudiosMapper, BookChapterAudiosEntity> implements BookChapterAudiosService {

    @Override
    public List<BookChapterAudiosEntity> getBookChapterAudios(Integer chapterId, Integer humanId, Integer type) {
        return list(new LambdaQueryWrapper<BookChapterAudiosEntity>()
                .eq(BookChapterAudiosEntity::getChapterId, chapterId)
                .eq(BookChapterAudiosEntity::getHumanId, humanId)
                .eq(BookChapterAudiosEntity::getType, type)
                .orderByAsc(BookChapterAudiosEntity::getSort));
    }
}
