package com.ym.mec.biz.event.source;

import com.ym.mec.biz.dal.enums.GroupType;
import com.ym.mec.biz.event.StudentCourseChangeEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author Joburgess
 * @Date 2020.09.24
 */
@Service
public class StudentEventSource {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Resource
    private ApplicationContext applicationContext;

    /**
     * @describe 学生课程计划变更通知
     * @author Joburgess
     * @date 2020.09.24
     * @param userIds: 用户编号
     * @return void
     */
    public void studentCourseChange(String groupId, GroupType groupType, Integer... userIds) {
        applicationContext.publishEvent(new StudentCourseChangeEvent(this, groupId, groupType, userIds));
    }
}
