package com.ozs.appshow;

import javax.servlet.MultipartConfigElement;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@MapperScan("com.ozs.appshow.mapper")
@EnableSwagger2
@EnableEurekaClient
@EnableFeignClients
@SpringBootApplication
public class AppShowpplication {

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

	/**
	 * 文件上传配置
	 * 
	 * @return
	 */
	@Bean
	public MultipartConfigElement multipartConfigElement() {
		MultipartConfigFactory factory = new MultipartConfigFactory();
		// 文件最大
		factory.setMaxFileSize("512000KB"); // KB,MB
		/// 设置总上传数据总大小
		factory.setMaxRequestSize("512000KB");
		return factory.createMultipartConfig();
	}

}
