package rd;

import com.github.yitter.contract.IdGeneratorOptions;
import com.github.yitter.idgen.YitIdHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableAsync
@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement
@MapperScan(basePackages = "rd.dao.mapper")
public class BackendMain {
    public static void main(String[] args) {
        IdGeneratorOptions options = new IdGeneratorOptions();
        options.WorkerIdBitLength = 4;
        options.WorkerId = 0;
        YitIdHelper.setIdGenerator(options);

        SpringApplication.run(BackendMain.class, args);
    }
}
