docs: 同步 P6 工作日志、runbook 与服务 README

- known-issues.md: 追加 9 条 P6 工作经验日志,更新 arch-scan 经验
- post-p6-followup.md: 新增 P6 后续工作手册 runbook
- iam/core-edu/content/msg README: 补充健康检查端点说明
This commit is contained in:
SpecialX
2026-07-08 12:53:05 +08:00
parent 20b1afd9ab
commit beedbaf686
6 changed files with 1321 additions and 247 deletions

View File

@@ -29,14 +29,14 @@ pnpm test
## 环境变量
| 变量 | 说明 |
|------|------|
| `PORT` | 服务端口(默认 3005 |
| `DATABASE_URL` | MySQL 连接串 |
| `NEO4J_URL` | Neo4j Bolt 连接 URL |
| `NEO4J_PASSWORD` | Neo4j 密码 |
| `ES_URL` | Elasticsearch 地址 |
| `JWT_SECRET` | JWT 密钥 |
| 变量 | 说明 |
| ----------------------------- | ------------------------------- |
| `PORT` | 服务端口(默认 3005 |
| `DATABASE_URL` | MySQL 连接串 |
| `NEO4J_URL` | Neo4j Bolt 连接 URL |
| `NEO4J_PASSWORD` | Neo4j 密码 |
| `ES_URL` | Elasticsearch 地址 |
| `JWT_SECRET` | JWT 密钥 |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OpenTelemetry OTLP 端点(可选) |
## 模块结构
@@ -60,6 +60,15 @@ src/
- `TextbooksService.createKnowledgeGraph` 在 Neo4j 构建知识点前置依赖
- `TextbooksService.getPrerequisites` 查询知识点前置链路
## 健康检查
| 端点 | 用途 | 鉴权 |
| -------------- | ------------------------------------------------- | ---- |
| `GET /healthz` | 存活探针liveness仅返回进程状态不检查依赖 | 无 |
| `GET /readyz` | 就绪探针readiness检查 DB 连接,失败返回 503 | 无 |
实现见 `src/shared/health/health.controller.ts`5 个 NestJS 服务iam/core-edu/content/msg/classes一致。
## 对外契约
gRPC 服务 `TextbookService``KnowledgeGraphService` 定义见 `packages/shared-proto/proto/content.proto`

View File

@@ -43,10 +43,19 @@ pnpm test
## 环境变量
| 变量 | 说明 | 默认 |
|------|------|------|
| `PORT` | 服务端口 | 3004 |
| `DATABASE_URL` | MySQL 连接串 | - |
| `KAFKA_BROKERS` | Kafka broker 列表(逗号分隔) | localhost:9092 |
| `JWT_SECRET` | JWT 密钥 | - |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP 上报地址(可选) | - |
| 变量 | 说明 | 默认 |
| ----------------------------- | ----------------------------- | -------------- |
| `PORT` | 服务端口 | 3004 |
| `DATABASE_URL` | MySQL 连接串 | - |
| `KAFKA_BROKERS` | Kafka broker 列表(逗号分隔) | localhost:9092 |
| `JWT_SECRET` | JWT 密钥 | - |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP 上报地址(可选) | - |
## 健康检查
| 端点 | 用途 | 鉴权 |
| -------------- | ------------------------------------------------- | ---- |
| `GET /healthz` | 存活探针liveness仅返回进程状态不检查依赖 | 无 |
| `GET /readyz` | 就绪探针readiness检查 DB 连接,失败返回 503 | 无 |
实现见 `src/shared/health/health.controller.ts`5 个 NestJS 服务iam/core-edu/content/msg/classes一致。

View File

@@ -23,12 +23,21 @@
## API
| Method | Path | 说明 |
|--------|------|------|
| POST | `/iam/register` | 注册 |
| POST | `/iam/login` | 登录 |
| POST | `/iam/refresh` | 刷新令牌 |
| GET | `/iam/me` | 当前用户信息(需 `x-user-id` 头) |
| Method | Path | 说明 |
| ------ | --------------- | --------------------------------- |
| POST | `/iam/register` | 注册 |
| POST | `/iam/login` | 登录 |
| POST | `/iam/refresh` | 刷新令牌 |
| GET | `/iam/me` | 当前用户信息(需 `x-user-id` 头) |
## 健康检查
| 端点 | 用途 | 鉴权 |
| -------------- | ------------------------------------------------- | ---- |
| `GET /healthz` | 存活探针liveness仅返回进程状态不检查依赖 | 无 |
| `GET /readyz` | 就绪探针readiness检查 DB 连接,失败返回 503 | 无 |
实现见 `src/shared/health/health.controller.ts`5 个 NestJS 服务iam/core-edu/content/msg/classes一致。
## 数据表

View File

@@ -25,19 +25,28 @@ pnpm dev # http://localhost:3007
## API
| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /notifications | 发送通知 |
| GET | /notifications | 查询用户通知列表 |
| POST | /notifications/:id/read | 标记已读 |
| GET | /notifications/search?q= | 全文检索通知 |
| 方法 | 路径 | 说明 |
| ---- | ------------------------ | ---------------- |
| POST | /notifications | 发送通知 |
| GET | /notifications | 查询用户通知列表 |
| POST | /notifications/:id/read | 标记已读 |
| GET | /notifications/search?q= | 全文检索通知 |
## 健康检查
| 端点 | 用途 | 鉴权 |
| -------------- | ------------------------------------------------- | ---- |
| `GET /healthz` | 存活探针liveness仅返回进程状态不检查依赖 | 无 |
| `GET /readyz` | 就绪探针readiness检查 DB 连接,失败返回 503 | 无 |
实现见 `src/shared/health/health.controller.ts`5 个 NestJS 服务iam/core-edu/content/msg/classes一致。
## 环境变量
| 变量 | 默认值 | 说明 |
|------|--------|------|
| PORT | 3007 | 服务端口 |
| DATABASE_URL | - | MySQL 连接串 |
| KAFKA_BROKERS | localhost:9092 | Kafka broker 列表 |
| ES_URL | http://localhost:9200 | Elasticsearch 地址 |
| JWT_SECRET | - | JWT 密钥 |
| 变量 | 默认值 | 说明 |
| ------------- | --------------------- | ------------------ |
| PORT | 3007 | 服务端口 |
| DATABASE_URL | - | MySQL 连接串 |
| KAFKA_BROKERS | localhost:9092 | Kafka broker 列表 |
| ES_URL | http://localhost:9200 | Elasticsearch 地址 |
| JWT_SECRET | - | JWT 密钥 |