package com.ruoyi.school.course.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.page.RespPage;
import com.ruoyi.school.course.domain.req.course.ReqSearchScCourse;
import com.ruoyi.school.course.domain.resp.course.RespSearchCourse;
import com.ruoyi.school.course.mapper.ScCourseChargeMapper;
import com.ruoyi.school.course.mapper.ScCourseMapper;
import com.ruoyi.school.course.domain.ScCourse;
import com.ruoyi.school.course.service.IScCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课程信息 服务实现类
 * </p>
 *
 * @author zhangby
 * @since 2020-03-17 11:25:55
 */
@Service
public class ScCourseServiceImpl extends ServiceImpl<ScCourseMapper, ScCourse> implements IScCourseService {

    @Autowired
    private ScCourseChargeMapper courseChargeMapper;

    @Override
    public RespPage<RespSearchCourse> searchCourse(ReqSearchScCourse reqSearchScCourse) {
        RespPage<RespSearchCourse> respPage = new RespPage<>(reqSearchScCourse.getPageNum(),reqSearchScCourse.getPageSize());
        List<RespSearchCourse> courseList = baseMapper.selectCourseList(reqSearchScCourse, respPage);
        respPage.setRows(courseList);
        return respPage;
    }
}
