H0-06 补齐 iOS 核心流程 DTO(import / source / learning-session) #51
Closed
opened 2026-05-24 21:49:32 +08:00 by wangdl
·
2 comments
Labels
Clear labels
area:activity
活动/统计
area:admin
管理后台
area:admin-api
area:ai
AI/RAG
area:ai-runtime
AI Runtime / AI 分析体系相关
area:analytics
area:api
API 接口
area:auth
认证与授权
area:cos
对象存储
area:database
数据库/Migration
area:import
文件导入/解析
area:knowledge
知识库/知识点
area:learning-info
area:learning-session
area:quiz
测验/自测
area:reading-event
area:reading-progress
area:review
复习系统
area:security
安全相关
audit:api-admin-info
audit:api-info
audit:planned
已完成宏观规划,尚未代码审查
audit:reviewed
blocked-by:api-info-aggregation
blocked-by:api-info-core
blocked-by:api-info-ops
blocked-by:api-info-schema
blocked-by:processor
blocked-by:schema
priority:p0
最高优先级,阻塞发布
priority:p1
高优先级,里程碑必需
priority:p2
中优先级,后续版本
repo:api
API 仓库 Issue
status:blocked
被阻塞
status:done
已完成
status:partial
status:todo
type:aggregation
type:bug
缺陷修复
type:design
设计
type:docs
文档
type:feature
新功能
type:migration
type:refactor
重构
type:test
work:admin-api
work:aggregation
work:api
work:artifact
题目/卡片产物
work:audit
work:circuit-breaker
熔断
work:contract
work:design
架构/协议设计工作
work:docs
work:export
work:extend-existing
work:internal-api
Runtime 内部接口
work:job
Job 调度相关
work:new-module
work:new-table
work:ops
work:query
work:quota
额度/限流
work:schema
Prisma Schema 设计
work:security
work:service
Service 层实现
work:snapshot
Snapshot 构建
work:test
No Label
Milestone
No items
No Milestone
H0:iOS 对接阻断修复(P0)
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wangdl/api-server#51
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
为 import、source、learning-session 三个核心 Controller 补齐 DTO 定义,消除 @Body() any 的安全隐患。
背景说明
当前以下 Controller 使用 @Body() any 接收请求体,缺少类型校验和 Swagger 文档:
这导致 iOS 端无法确认请求格式,也无法通过 Swagger 自测,是 iOS 对接的关键阻断点。
模块职责
请设计和补齐以下 DTO:
禁止事项
✅ H0-06 修复完成
问题
iOS 核心流程的三个 Controller(document-import、knowledge-source、learning-session)使用
@Body() body: any,无类型校验。iOS 客户端可能发送错误字段但拿到 201,直到 AI 异步处理阶段才失败。修改
src/modules/document-import/dto/create-import.dto.tssrc/modules/knowledge-source/dto/add-source.dto.tssrc/modules/learning-session/dto/start-session.dto.tssrc/modules/document-import/document-import.controller.ts@Body() body: any→@Body() dto: CreateImportDtosrc/modules/knowledge-source/knowledge-source.controller.ts@Body() dto: any→@Body() dto: AddSourceDtosrc/modules/learning-session/learning-session.controller.ts@Body() body: any→@Body() dto: StartSessionDtotest/mocks/ioredis.mock.tseval()mock 方法以支持 Redis lock/unlock 流程test/h0.e2e-spec.tsDTO 校验规则
测试
wangdl referenced this issue2026-06-05 19:34:43 +08:00
wangdl referenced this issue2026-06-05 19:34:43 +08:00
wangdl referenced this issue2026-06-05 19:34:43 +08:00
wangdl referenced this issue2026-06-05 19:36:06 +08:00
wangdl referenced this issue2026-06-05 19:36:07 +08:00
wangdl referenced this issue2026-06-05 19:36:07 +08:00
关闭
iOS APIModels.swift 已包含完整的 DTO:ImportStatusResponse, KnowledgeSource, LearningSession 等。APIService.swift 对应 service 方法已实现。