🟢 P2 | KnowledgeItem 新增 fileSize 字段 #66

Closed
opened 2026-05-30 16:25:33 +08:00 by wangdl · 1 comment
Owner

背景

排序功能需要按文件大小排序,当前 KnowledgeItem 模型无文件大小字段。

需求

KnowledgeItem 新增:
fileSize: Int? // 文件字节数,导入时写入

关联

排序 sortBy=fileSize

## 背景 排序功能需要按文件大小排序,当前 KnowledgeItem 模型无文件大小字段。 ## 需求 KnowledgeItem 新增: fileSize: Int? // 文件字节数,导入时写入 ## 关联 排序 sortBy=fileSize
wangdl added this to the H0:iOS 对接阻断修复(P0) milestone 2026-05-30 16:25:33 +08:00
Author
Owner

修复汇报 (2026-06-05)

实现

  1. Prisma SchemaKnowledgeItem 新增 fileSize BigInt? 字段
  2. Repositorycreate() DTO 新增 fileSize?
  3. Service enrichItem() — 刷新 COS URL 时同步调用 headObject 获取真实文件大小和 contentType,自动填充 fileSizesourceType

状态

代码完成,文件已传服务器。需 npx prisma migrate deploy + 重启 NestJS。

## 修复汇报 (2026-06-05) ### 实现 1. **Prisma Schema** — `KnowledgeItem` 新增 `fileSize BigInt?` 字段 2. **Repository** — `create()` DTO 新增 `fileSize?` 3. **Service enrichItem()** — 刷新 COS URL 时同步调用 `headObject` 获取真实文件大小和 contentType,自动填充 `fileSize` 和 `sourceType` ### 状态 ✅ 代码完成,文件已传服务器。需 `npx prisma migrate deploy` + 重启 NestJS。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/api-server#66
No description provided.