Commit Graph

10 Commits

Author SHA1 Message Date
SpecialX
1eacd1ed87 feat(teacher-portal): 完整实现 teacher-portal 微前端
包含 settings/students/api、graphql、mocks、ui-tokens 设计令牌等
2026-07-10 19:10:20 +08:00
SpecialX
0a71b02e04 fix: code compliance audit and fix across all services
Some checks failed
CI / quality-ts (push) Failing after 48s
CI / quality-go (push) Failing after 4s
CI / quality-proto (push) Failing after 2s
CI / deploy (push) Has been skipped
NestJS (6 services): implement @RequirePermission decorator with
SetMetadata+Reflector, register APP_GUARD globally, fix as assertions
to type guards, add explicit return types, fix import type for express,
fix /metrics implicit any, replace native Error with ApplicationError,
remove typeorm remnants, register LifecycleService.

teacher-bff: add logger, ApplicationError, GlobalErrorFilter, forward
real userId to downstream, log downstream failures, migrate health
controller to shared/health.

Go (2 services): interface to any, doc comments, CORS dev whitelist,
JWT secret fail-fast, push-gateway internal API auth, metrics and
readyz endpoints, remove dead code.

Python (2 services): lifespan return type, dev_mode to bool, data-ana
APIRouter, ai POST body model, ClickHouse async wrapping.
2026-07-09 17:28:27 +08:00
SpecialX
d8dab70406 feat(infra): add OTel auto-instrumentations across all services
Some checks failed
CI / quality-proto (push) Failing after 2s
CI / deploy (push) Has been skipped
CI / quality-ts (push) Failing after 1m11s
CI / quality-go (push) Failing after 5s
NestJS 6 services use getNodeAutoInstrumentations().

Python 2 services use FastAPIInstrumentor. Go 2 services use otelgin.
2026-07-09 13:25:46 +08:00
SpecialX
566060fade feat(infra): p6 hardening - observability and deploy compose
- 5 NestJS services add /metrics endpoint via app.getHttpAdapter()
- prometheus.yml scales to 8 services with rule_files and alertmanager
- monitoring compose replaces blackbox with Loki+Promtail
- Grafana datasource adds Loki
- docker-compose.deploy.yml scales to 11 services
- deploy.env.example completes Neo4j/ES/ClickHouse/LLM vars
- teacher-bff adds health.controller
- CI removes continue-on-error on lint step
- teacher-portal lint script changed to eslint src
2026-07-09 10:21:06 +08:00
SpecialX
3ca654619f chore(infra): 配置ESLint 9 flat config并恢复lint-staged集成
- 新增 eslint.config.js(ESLint 9 flat config 格式)
- 安装 @eslint/js + typescript-eslint + eslint-config-prettier
- 6 个 TS 服务 lint 脚本:eslint src --ext .ts → eslint src
- lint-staged 恢复 eslint --fix
- .gitignore 忽略 docker-compose.minimal.override.yml
- known-issues.md 新增 P6 硬化条目
2026-07-09 09:14:44 +08:00
SpecialX
416e1bc0b2 feat(msg): 修复通知服务并添加ES降级与Push Gateway推送
database.ts 导出db常量替代getDb()函数

env.ts JWT_SECRET/ES_URL改optional加DEV_MODE/PUSH_GATEWAY_URL

elasticsearch.ts ES降级: ES_URL未设置时esClient=null

notifications.service.ts 加createBatch+分页查询+Push Gateway推送调用

新建msg-init.sql创建2张表
2026-07-09 09:08:57 +08:00
SpecialX
b2c2f6e567 feat(teacher-bff): 添加视口聚合端点 + 修复身份头读取
- 新增 GET /teacher/viewports 聚合 IAM 视口配置
- 修复 controller 从 x-user-id header 读取身份(替代 AuthenticatedRequest)
- 添加 zod + @types/express 依赖
2026-07-09 00:49:24 +08:00
SpecialX
f658571726 fix(iam): 修复 TS 编译错误、ESM 依赖注入与身份头读取
P1 端到端验证中发现 IAM 服务存在 14 个 TS 编译错误与运行时 DI 失败:

- 移除 typeorm/ioredis/kafkajs 依赖(IAM 用 Drizzle)
- health.controller.ts 改用 db.execute(sql SELECT 1) 校验连接
- lifecycle.service.ts 简化为只关闭 Drizzle 连接池
- Drizzle API 修正:r.roles -> r.iam_roles,.in() -> inArray()
- ESM 模式下 DI 必须显式 @Inject(IamRepository)(参考 classes 黄金模板)
- iam.controller.ts 直接读 req.headers[x-user-id],不依赖未注册的 AuthMiddleware
- health.module.ts 补 .js 后缀
- package.json 补 @types/express

验证:register -> JWT -> Gateway /iam/me 200 -> /classes CRUD 200
2026-07-09 00:25:37 +08:00
SpecialX
a4ec5b72c5 fix(classes): 修复依赖注入与 ESM 导入路径
- classes.module.ts: 移除 useFactory,改用直接 provider 注册

- classes.service.ts: 添加 @Inject 装饰器显式注入 Repository

- health.module.ts: 修复 import 添加 .js 后缀(ESM 模式)

- package.json: 补充 ioredis/kafkajs/typeform 等运行时依赖
2026-07-08 15:11:12 +08:00
SpecialX
ff0ae1ac9c chore(deps): 同步 lockfile 与 teacher-portal 配置 2026-07-08 12:53:32 +08:00