- 新增 ImageName 实体类和对应的 Mapper- 在 MarkdownFileService 中添加图片文件名同步方法 - 优化 HomePage 组件,支持实时预览 Markdown 内容 - 新增 MarkdownImageExtractor 工具类,用于提取 Markdown 中的图片文件名
25 lines
769 B
Java
25 lines
769 B
Java
package com.test.bijihoudaun.config;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
|
import java.util.concurrent.Executor;
|
|
|
|
@Configuration
|
|
@EnableAsync
|
|
public class AsyncConfig {
|
|
|
|
@Bean("imageNameSyncExecutor")
|
|
public Executor imageNameSyncExecutor() {
|
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
|
executor.setCorePoolSize(5);
|
|
executor.setMaxPoolSize(10);
|
|
executor.setQueueCapacity(100);
|
|
executor.setThreadNamePrefix("imageNameSync-");
|
|
executor.initialize();
|
|
return executor;
|
|
}
|
|
}
|