update modules/kbase: mod 2 files

This commit is contained in:
jack ning
2025-05-17 16:42:55 +08:00
parent 6b82721152
commit 7ac7de2b0a
2 changed files with 20 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-09-07 15:42:23
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-05-17 10:35:00
* @LastEditTime: 2025-05-17 16:33:09
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
@@ -78,11 +78,14 @@ public class FaqEventListener {
} else {
// 使用原有的EasyExcel直接导入方式
log.info("使用EasyExcel直接导入FAQ: {}", filePath);
EasyExcel.read(filePath, FaqExcel.class, new FaqExcelListener(faqRestService,
EasyExcel.read(filePath,
FaqExcel.class,
new FaqExcelListener(faqRestService,
KbaseTypeEnum.LLM.name(),
upload.getUid(),
upload.getKbUid(),
upload.getOrgUid())).sheet().doRead();
upload.getOrgUid())
).sheet().doRead();
}
}
} catch (Exception e) {

View File

@@ -21,6 +21,7 @@ import org.springframework.batch.core.step.builder.StepBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.transaction.PlatformTransactionManager;
@@ -71,10 +72,22 @@ public class FaqBatchJobConfig {
.build();
}
/**
* 配置默认的Resource bean
* 这个是一个占位符资源,实际使用时会被替换
*/
@Bean
public Resource defaultExcelResource() {
// 提供一个默认的资源路径,可以根据实际情况调整
// 这里假设在classpath下有一个templates目录里面有一个空的模板文件
// 如果没有这个文件,在运行时会尝试找到它并报错,但应用程序会正常启动
return new ClassPathResource("templates/faq_template.xlsx");
}
/**
* 配置FAQ Excel读取器
*
* @param resource Excel文件资源
* @param resource Excel文件资源如果不手动指定则使用defaultExcelResource
* @return 配置好的Excel读取器
*/
@Bean