package com.scm.contract.config;

import com.scm.contract.service.management.TagDataService;
import com.scm.contract.service.quartz.QuartzJobService;
import com.scm.contract.tools.InSnowflakeIdGenerator;
import com.scm.contract.tools.MaterielSerialNumber;
import com.scm.contract.tools.OutSnowflakeIdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author zuo
 * @date 2024/6/21 22:51
 */
@Component
public class CommandLineRunnerImpl implements CommandLineRunner {

    @Autowired
    private TagDataService tagDataService;

    @Autowired
    private OutSnowflakeIdGenerator outSnowflakeIdGenerator;

    @Autowired
    private InSnowflakeIdGenerator inSnowflakeIdGenerator;

    @Autowired
    private MaterielSerialNumber materielSerialNumber;

    @Autowired
    private QuartzJobService quartzJobService;


    @Override
    public void run(String... args) throws Exception {
        tagDataService.setAlarm();
        outSnowflakeIdGenerator.into();
        inSnowflakeIdGenerator.into();
        materielSerialNumber.into();
        quartzJobService.init();
    }
}
