7 Commits

Author SHA1 Message Date
wangdl
b9f8334245 feat: H0-08 KnowledgeBase 增加业务字段 + 订阅 + 发现 + 置顶 + 公开
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 11s
Schema 新增:
- coverType/coverIcon/coverColor(封面类型/系统图标/颜色)
- visibility(private/public)
- isPinned(置顶)
- ownerType(user/official)
- isVerified(认证标识)
- KnowledgeBaseSubscription 表

API 新增:
- POST /knowledge-bases/:id/pin(切换置顶)
- PATCH /knowledge-bases/:id/visibility(切换公开/私有)
- POST /knowledge-bases/:id/subscribe(订阅)
- DELETE /knowledge-bases/:id/subscribe(取消订阅)
- GET /knowledge-bases/subscribed(已订阅列表)
- GET /knowledge-bases/discover(发现公开库)

增强:
- findAll 支持 visibility/ownerType 筛选 + 置顶优先排序
- findOne 公开库允许任何人查看
- update 支持所有新字段

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 19:24:21 +08:00
wangdl
4f59569b7c feat: KB 列表返回 coverUrl(coverKey → 预签名下载URL)
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 43s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 10:48:34 +08:00
81c49ca067 fix: add @Optional() to ContentSafetyService in KnowledgeBaseService
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 33s
NestJS couldn't resolve ContentSafetyService because ContentSafetyModule
is not imported in KnowledgeBaseModule, causing app startup crash.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 11:42:41 +08:00
052cd5cba8 feat: M2-02 — Workspace + KnowledgeBase + Folder management
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 11s
- Workspace + KnowledgeFolder Prisma models
- Folder CRUD: create/list/update/delete (soft-delete with children)
- Content Safety integration for KB title on create/update
- E2E: KB create, folder CRUD, admin KB list

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 11:23:58 +08:00
08f31dd5b6 feat: P0 后端补全 — BullMQ Workers 注册 + 用户 Profile API + 角色权限
- AppModule 注册 3 个 BullMQ Workers (AiAnalysis/DocumentImport/Notification)
- Users 模块新增 GET/PATCH /users/me/profile 端点:
  - GET 读取 UserProfile (learningIdentity, learningDirection, bio, currentGoal)
  - PATCH upsert UserProfile
  - GET /users/me 返回 profile + preferences (include join)
- 新增 RolesGuard + @Roles() 装饰器 (UserRole enum)
- QueueModule/QueueService 改进
- 各模块 controller/repository/service 完善

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 19:08:07 +08:00
ef7c1f1bc9 feat: 安全基线 + 4个安全漏洞修复 - JWT AuthGuard/OptionalAuthGuard, StrictValidationPipe, 全局异常过滤器, Redis限流429, Apple登录mock模式, BigInt精度修复, SECURITY.md 2026-05-09 18:57:33 +08:00
35de65e99b feat: 重构 api-server 为模块化单体架构,接入 MySQL + Redis
- 按 BACKEND-PLAN.md 将项目重构为 4 层架构:
  config/ -> common/ -> infrastructure/ -> modules/
- 15 个业务模块,遵循 Controller → Service → Repository 分层
- infrastructure: PrismaService / RedisService / QueueService / AiService / StorageService
- common: guards / interceptors / filters / pipes / decorators / dto / types / utils
- Prisma schema 含 27 张表,MySQL 8.0 服务器 db push 成功
- Redis 7 接入: 限流/任务状态/分布式锁/队列预留
- ai-analysis 模块: 每日 50 次限流 + 重复提交锁 + 异步任务状态追踪
- document-import 模块: 异步导入流程 + 进度追踪
- notifications 模块: BullMQ notification 队列预留
- /health 端点实时返回 database + redis 连接状态
- Swagger 注册 15 个 tag,67 个路由全部映射
2026-05-09 18:25:04 +08:00