package com.fdkanfang;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * Created by owen on 2020/2/28 0028 17:18
 */
@Slf4j
@SpringBootApplication
public class FdkanfangApplication extends SpringBootServletInitializer {

    //设置上传文件的大小，限制为1g
    @Bean(name = "multipartResolver")
    public CommonsMultipartResolver getCommonsMultipartResolver() {
        CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
        multipartResolver.setMaxUploadSize(1024000000);
        multipartResolver.setMaxInMemorySize(1024000000);
        return multipartResolver;
    }


    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(FdkanfangApplication.class);
        application.setBannerMode(Banner.Mode.CONSOLE);
        application.run(args);

    }

}



