package com.yonge.cooleshow.biz.dal.service.impl;

import com.dayaedu.cbs.openfeign.service.CbsSubjectService;
import com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectApiWrapper;
import com.yonge.cooleshow.biz.dal.entity.Subject;
import com.yonge.cooleshow.biz.dal.service.SubjectService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CbsSubjectServiceImpl implements CbsSubjectService {

    private static final Logger log = LoggerFactory.getLogger(CbsSubjectServiceImpl.class);

    @Resource
    private SubjectService subjectService;

    public Boolean checkSubjectEnable(CbsSubjectApiWrapper.CheckSubjectDto checkSubjectDto) {
        Subject subject = subjectService.getDao().getByCbsId(checkSubjectDto.getSubjectId());
        if (subject != null){
            return true;
        }
        return false;
    }

    public List<CbsSubjectApiWrapper.Subject> list(CbsSubjectApiWrapper.SubjectQuery query) {
        return subjectService.getDao().queryCbsList(query);
    }
}