| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.web.servlet.MultipartConfigFactory; |
| | | import org.springframework.context.ApplicationListener; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.event.ContextRefreshedEvent; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | import org.yeshi.utils.mq.JobThreadExecutorServiceImpl; |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | import org.yeshi.utils.tencentcloud.entity.COSInitParams; |
| | | |
| | | import javax.servlet.MultipartConfigElement; |
| | | import java.io.File; |
| | | import java.util.Properties; |
| | | |
| | | //不引入数据库 |
| | |
| | | COSManager.getInstance().init(params); |
| | | } |
| | | |
| | | /** |
| | | * 设置文件上传临时保存目录 |
| | | */ |
| | | @Bean |
| | | MultipartConfigElement multipartConfigElement() { |
| | | MultipartConfigFactory factory = new MultipartConfigFactory(); |
| | | String location = System.getProperty("user.dir") + "/data/tmp"; |
| | | File tmpFile = new File(location); |
| | | if (!tmpFile.exists()) { |
| | | tmpFile.mkdirs(); |
| | | } |
| | | factory.setLocation(location); |
| | | return factory.createMultipartConfig(); |
| | | } |
| | | |
| | | } |