package com.sooka.sponest.monitor;

import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.util.unit.DataSize;

import javax.servlet.MultipartConfigElement;

@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringBootApplication
public class SookaMonitorApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(SookaMonitorApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  首佳科技 一体化 监控中心 启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                "  __________   ____ |  | _______          ____________   ____   ____   ____   _______/  |_\n"+
                " /  ___/  _ \\ /  _ \\|  |/ /\\__  \\        /  ___/\\____ \\ /  _ \\ /    \\_/ __ \\ /  ___/\\   __\\\n"+
                " \\___ (  <_> |  <_> )    <  / __ \\_      \\___ \\ |  |_> >  <_> )   |  \\  ___/ \\___ \\  |  |\n"+
                "/____  >____/ \\____/|__|_ \\(____  /     /____  >|   __/ \\____/|___|  /\\___  >____  > |__|\n"+
                "     \\/                  \\/     \\/           \\/ |__|               \\/     \\/     \\/\n"
        );
    }

    @Bean
    public MultipartConfigElement multipartConfigElement(){
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize(DataSize.parse("10240000KB"));
        factory.setMaxRequestSize(DataSize.parse("10240000KB"));
        return factory.createMultipartConfig();
    }
}
