package com.ssj.service.course.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.alibaba.dubbo.config.annotation.Service;
import com.ssj.bean.course.domain.CourseFeedbackFile;
import com.ssj.dao.course.dao.CourseQueryDao;
import com.ssj.dao.course.dao.IFeedbackFileDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.course.service.ICourseFeedbackFileService;

@Service(version="1.0")
@Transactional
public class CourseFeedbackFileServiceImpl extends BaseServiceImpl<CourseFeedbackFile, String> implements ICourseFeedbackFileService {

	@Autowired
	private IFeedbackFileDao dao;
	@Autowired
	private CourseQueryDao courseQueryDao;
	
	@Override
	public PagingAndSortingRepository<CourseFeedbackFile, String> getDao() {
		
		return dao;
	}

	@Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
	public CourseFeedbackFile findOneData(String libId, String courseDetailId) {
		
		return dao.findOneData(libId,courseDetailId);
	}

	@Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
	public List<String> getRedFlowList3(String libId, String vipId, String courseDetailId) {
		
		return dao.getRedFlowList3(libId,vipId,courseDetailId);
	}

	@Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
	public Integer getRedFlowCount(String libId, String vipId, String courseDetailsId, Date openTime) {
	
		return dao.getRedFlowCount(libId,vipId,courseDetailsId,openTime);
	}

	@Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
	public List<String> getImgList(String libId, String backId, String courseDetailsId, Date openTime) {
		
		return dao.getImgList(libId,backId,courseDetailsId,openTime);
	}

	@Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
	public List<Map<String, Object>> getNextFile(String courseSeriesId, int num,
			String fileType) {
		return courseQueryDao.getNextFile(courseSeriesId, num-3,num+3, fileType);
	}

	

}
