package com.pingcap.syngmail;

import com.pingcap.syngmail.config.YamlPropertySourceFactory;
import com.pingcap.syngmail.service.EmployeeService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;

@SpringBootApplication
@MapperScan("com.pingcap.syngmail.mapper")
@PropertySource(factory = YamlPropertySourceFactory.class, value = "classpath:application.yml")
public class SynGmailApplication implements CommandLineRunner {
    @Autowired
    EmployeeService employeeService;

    public static void main(String[] args) {
        SpringApplication.run(SynGmailApplication.class, args);
    }

    @Override
    public void run(String... args) {
        employeeService.synGmailInfo();
    }
}