Files
quality_analyse/backend
lyun ff7bbe3e46 同步:完善质量分析工作台并更新主题字体
同步已上线的智能分析执行协议、来源查询、图表报告与管理页面配套代码。
补齐数据库迁移、运行依赖和回归测试,保留原有指标计算口径。
统一午夜黑及其他主题的控件细节、中文和业务数字字体。
排除本地业务数据、凭据、预览、发布与验收产物。

验证:生产构建通过,320项前端回归通过;本轮仅同步Git,不再次部署。
2026-10-30 22:40:58 +08:00
..

Quality platform backend

Java 21 / Spring Boot API and ingestion service. The service binds to 127.0.0.1:5281; its production data store is MySQL 8.4 with Flyway migrations. There is no embedded database fallback.

Local configuration

Set the following environment variables before starting the API:

  • MYSQL_URL — JDBC URL for the local MySQL database, including UTF-8 and UTC options.
  • MYSQL_USER and MYSQL_PASSWORD — least-privilege application account.
  • QUALITY_ARCHIVE_ROOT — absolute directory for immutable source revisions and runtime artifacts (defaults to ./runtimedata/archive).
  • QUALITY_ALLOWED_ROOTS — path-separator-delimited directories that the scanner may inspect. Each entry is canonicalized; symlinks escaping the configured root are rejected.
  • QUALITY_BOOTSTRAP_ADMIN_USERNAME and QUALITY_BOOTSTRAP_ADMIN_PASSWORD — optional one-time local administrator bootstrap. Neither value is logged. Omit both to require provisioning through an existing administrative path.

The API does not accept a filesystem path from a browser as a scan target. Callers select source IDs returned by /api/sources. Multipart uploads are stored under the archive root after size and extension checks. Files without a year in their name use QUALITY_DEFAULT_SOURCE_YEAR (default 2026), matching the current workbook title.

Run

From this directory, use the Maven wrapper when present, or Maven 3.9+:

mvn spring-boot:run

Flyway applies src/main/resources/db/migration at startup. The initial account must be explicitly bootstrapped; no public default credentials are created.

API

The front-end contract is served below /api. GET /api/auth/csrf returns a CSRF token and sets XSRF-TOKEN; mutation requests include the same value in X-XSRF-TOKEN. The authenticated session cookie is HttpOnly and SameSite=Strict. Data APIs require a session, and management mutations additionally require role authorization and an idempotency key or expected-version check.