refactor: AI 提示词外置为 Thymeleaf 模板并集中加载

- 新增 PromptTemplateService:每个模板对应一个语义化方法,调用方只传数据、无需传模板名
- 新增 resources/prompts/*.tpl 共 12 个提示词模板(TEXT 模式)
- application.yml 配置 spring.thymeleaf 前缀 classpath:/prompts/、后缀 .tpl
- 9 个 AI 服务移除硬编码提示词与拼接逻辑,统一改用 PromptTemplateService
- 两处 buildUserPrompt 补充隐私白名单注释,禁止加入 amount/rawData/externalNo
- 新增 PromptTemplateServiceTest 与 AiPromptPayloadPrivacyTest
This commit is contained in:
2026-09-21 11:17:42 +08:00
parent 1f520f4376
commit 96130d269e
26 changed files with 566 additions and 132 deletions
+2
View File
@@ -28,6 +28,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-mail'
// Thymeleaf(TEXT 模式):加载 classpath:/prompts 下的 AI 提示词模板
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.security:spring-security-crypto'
implementation 'com.baomidou:mybatis-plus-spring-boot3-starter:3.5.12'