package com.ym.mec.biz.service.impl;

import com.ym.mec.biz.dal.dao.CloudTeacherFreeCourseDao;
import com.ym.mec.biz.dal.entity.CloudTeacherFreeCourse;
import com.ym.mec.biz.service.CloudTeacherFreeCourseService;
import com.ym.mec.common.dal.BaseDAO;
import com.ym.mec.common.service.impl.BaseServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CloudTeacherFreeCourseServiceImpl extends BaseServiceImpl<Long, CloudTeacherFreeCourse>  implements CloudTeacherFreeCourseService {
	
	@Autowired
	private CloudTeacherFreeCourseDao cloudTeacherFreeCourseDao;

	@Override
	public BaseDAO<Long, CloudTeacherFreeCourse> getDAO() {
		return cloudTeacherFreeCourseDao;
	}

	@Override
	public CloudTeacherFreeCourseDao getDao() {
		return cloudTeacherFreeCourseDao;
	}

    @Override
	@Transactional(rollbackFor = Exception.class)
    public void batchInsert(List<Long> scheduleIdList,Long calenderId) {
		cloudTeacherFreeCourseDao.batchInsert(StringUtils.join(scheduleIdList,","),calenderId);
    }
}