Files
xiaoqu_mcp_service/xiaoqu-agent-service/src/main/resources/application.yml
T
wangheng 6639b93c45 feat(mcp): 增量同步框架与 users/properties/contracts changes 工具 (REQ-20260911-0013)
- 通用 ChangesEngine:snapshot 钉住 data_cutoff_at、(modify_time,id) 复合游标、
  仅最后一页签发 next_sync_token、软删 tombstone;sync_token/cursor 为
  HMAC-SHA256 无状态令牌(SyncTokenCodec),过期/篡改/跨快照/数据域变更
  统一 SYNC_CURSOR_EXPIRED
- 注册式实体扩展:SyncEntity/Registry + users(m0.user)/properties(m0.properyt)/
  contracts(m2.contract_new) 三个实现;生效修改时间 COALESCE(modify_time, create_time)
- 硬约束:GuardedToolCallback 对 *.changes.list 拒绝 tenant_id/scope 入参,
  数据域只从 Token 推导;行级权限复用 PermissionService 与 QUERY 工具同一 ACL
- 资源隔离:RateLimitService SYNC/QUERY 分档限流(Redis 固定分钟窗)、
  limit≤200 截断、SyncQueryTimeoutInterceptor 慢查询超时(三套 SqlSessionFactory 接入)
- contract.list.query 补齐 12 字段、contract.detail.query 补 version(ACL 不变)
- V5 migration:tool.description 512→1024(含 sql/rollback 回滚文件)
- seed-dev.sql:三个 changes 工具绑定进 sync 作用域
- 修复:properyt.customerId 为 NULL 时 Collectors.toMap NPE(冒烟命中),
  改为 put 逐条装填(ContractsSyncEntity/ContractTools)
2026-09-14 12:19:36 +08:00

63 lines
2.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server:
port: 8088
servlet:
session:
timeout: 30m
cookie:
http-only: true
same-site: strict
secure: ${ADMIN_COOKIE_SECURE:false}
app:
admin:
bootstrap:
account: ${ADMIN_BOOTSTRAP_ACCOUNT:}
password: ${ADMIN_BOOTSTRAP_PASSWORD:}
name: ${ADMIN_BOOTSTRAP_NAME:系统管理员}
open:
# /api/open 服务间静态密钥;为空 = Open API 关闭。dev 明文见 application-dev.yml
# 旧密钥不限作用域,仅存量用户 Token ensure 可用;
# 签发 service 类型 Token 需在 app.open.clients 中配置绑定了作用域的密钥
#(prod 用环境变量宽松绑定注入,如 APP_OPEN_CLIENTS_0_KEY / _0_NAME / _0_SCOPES_0,勿写明文)
api-key: ${OPEN_API_KEY:}
# 增量同步(REQ-20260911-0013):sync_token/cursor 签名密钥(为空时从 token-cipher-key 派生)、
# 快照有效期、单页上限与慢查询超时(秒)
sync:
token-key: ${SYNC_TOKEN_KEY:}
cursor-ttl-hours: ${SYNC_CURSOR_TTL_HOURS:24}
query-timeout-seconds: ${SYNC_QUERY_TIMEOUT_SECONDS:10}
default-limit: ${SYNC_DEFAULT_LIMIT:100}
max-limit: ${SYNC_MAX_LIMIT:200}
# 工具调用限流(每 Token 每分钟):SYNC 与 QUERY 分档互不占配额;0=关闭该档位
rate-limit:
query-per-minute: ${QUERY_RATE_LIMIT_PER_MINUTE:600}
sync-per-minute: ${SYNC_RATE_LIMIT_PER_MINUTE:120}
spring:
application:
name: xiaoqu-agent-service
flyway:
enabled: true
locations: classpath:db/migration
baseline-on-migrate: ${SVC_FLYWAY_BASELINE_ON_MIGRATE:false}
baseline-version: 1
baseline-description: legacy V1 schema
validate-on-migrate: true
validate-migration-naming: true
out-of-order: false
clean-disabled: true
ai:
mcp:
server:
name: xiaoqu-agent-service
version: 0.1.0
# Streamable HTTP 传输(Spring AI 1.1.8 已修复 Boot 3.5.x 下的 streamable NPE,
# 见 spring-projects/spring-ai#6274),默认端点 /mcp
protocol: STREAMABLE
# SYNC:工具回调在 servlet 请求线程上同步执行,ThreadLocal 鉴权上下文有效(实测验证)
type: SYNC
logging:
level:
me.iiv.agent: debug