package com.yida.data.user.config;

import cc.mrbird.febs.common.redis.service.RedisService;
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
import com.yida.data.common.service.CommonService;
import com.yida.data.school.feign.facility.RemoteDormitoryService;
import com.yida.data.user.service.EduStudentService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * excel功能配置类
 *
 * @author ZYJ
 * @date 2023/10/20
 */
@Configuration
public class ExcelConfiguration {

    @Value("${febs.uploadUrl}")
    private String uploadUrl;

    @Bean
    ExportStudentClient exportStudentClient(
            EduStudentService eduStudentService,
            RedisService redisService, CommonService commonService) {
        return new ExportStudentClient(eduStudentService, redisService, commonService,
                CachePrefixConstant.EXPORT_STUDENT_DATA, uploadUrl);
    }

    @Bean
    ExportStudentDormClient exportStudentDormClient(
            EduStudentService eduStudentService,
            RedisService redisService, CommonService commonService, RemoteDormitoryService remoteDormitoryService) {
        return new ExportStudentDormClient(eduStudentService, redisService, commonService,
                CachePrefixConstant.EXPORT_STUDENT_DORM_DATA, uploadUrl, remoteDormitoryService);
    }

}
