package cn.iocoder.byzs.module.web.service.course;

import cn.iocoder.byzs.module.bjdx.controller.admin.coursetype.vo.CourseTypeListReqVO;
import cn.iocoder.byzs.module.bjdx.dal.dataobject.coursetype.CourseTypeDO;
import cn.iocoder.byzs.module.bjdx.service.coursetype.CourseTypeService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import java.util.List;

/**
 * web课程类型 Service 实现类
 *
 * @author lyb
 */
@Service
@Validated
public class WebCourseTypeServiceImpl {

    @Resource
    private CourseTypeService courseTypeService;

    public List<CourseTypeDO> selectCourseTypeList(CourseTypeListReqVO reqVO) {
        List<CourseTypeDO> list = courseTypeService.getCourseTypeList(reqVO);
        if(reqVO.getCtParentId() != null){
            reqVO.setCtParentId(-1);
        }
        List<CourseTypeDO> listAll = courseTypeService.getCourseTypeList(reqVO);
        list.addAll(listAll);
        return list;
    }


}