server: port: 8090 spring: application: name: oa-backend servlet: multipart: # Real file upload (FileController). Single file up to 50MB; whole request a bit larger. max-file-size: 50MB max-request-size: 60MB # --------------------------------------------------------------------------- # Active datasource: SQLite (file-based, zero-setup). The MySQL and Postgres # profiles are provided as stubs (application-mysql.yml / application-postgres.yml) # so switching databases later is config-only: run with # --spring.profiles.active=mysql (or postgres) # and supply the JDBC url/credentials there. No Java code changes required. # --------------------------------------------------------------------------- datasource: url: jdbc:sqlite:./data/oa.db driver-class-name: org.sqlite.JDBC username: password: jpa: hibernate: ddl-auto: update database-platform: org.hibernate.community.dialect.SQLiteDialect open-in-view: false show-sql: false properties: hibernate: dialect: org.hibernate.community.dialect.SQLiteDialect format_sql: false hbm2ddl: # 逐表读取列元数据,避免 SQLite 在表数量较多时报 # "too many terms in compound SELECT"(启动期 schema 校验崩溃)。 jdbc_metadata_extraction_strategy: individually # CORS origins allowed for /api/** are configured in WebConfig (CorsConfig). # Allowed: http://localhost:8080, http://localhost:5173, http://127.0.0.1:* logging: level: root: INFO com.kaidi.oa: INFO # --------------------------------------------------------------------------- # 统一 AI 服务层 (AiService -> Anthropic Messages API)。 # api-key 留空 = 优雅降级模式:/api/oa/ai/* 不报错,返回 configured=false 的提示,活体不崩。 # 要真正产出 AI 结果:把 api-key 填上,或设置环境变量 ANTHROPIC_API_KEY。 # --------------------------------------------------------------------------- oa: ai: api-key: "" model: claude-haiku-4-5-20251001