DOC-FULL-035:V2 与 API 上传协议映射文档 #111

Closed
opened 2026-06-10 21:18:33 +08:00 by wangdl · 1 comment
Owner

目标

说明 Rust ReadingEvent V2 如何映射到 iOS UploadItem / API ReadingEvent 上传协议。

Rust 输出字段

  • eventId
  • clientSessionId
  • materialId
  • eventType
  • position
  • activeSecondsDelta
  • timestampMs
  • sequence

iOS 补充字段

  • readingTargetType
  • platform
  • appVersion
  • clientTimezoneOffsetMinutes
  • knowledgeBaseId?

API 解析字段

  • userId
  • serverReceivedAt
  • status
  • errorCode
  • warningCodes

必须说明

  1. Rust 不生成 readingTargetType。
  2. Rust 不生成 userId。
  3. timestampMs 在 iOS/API 侧转换为 clientTimestamp。
  4. activeSecondsDelta 是唯一计时输入。
  5. position 使用 camelCase JSON。
  6. iOS ack 时机是本地队列写入成功,不是 API 上传成功。

验收标准

  1. 新增 docs/reading-event-v2-api-mapping.md。
  2. 字段映射表完整。
  3. 明确 Rust / iOS / API 的职责。
  4. 明确不应把 readingTargetType 放回 Rust。
  5. 明确 activeSecondsDelta 语义。
  6. 可供 API / iOS 对齐使用。
## 目标 说明 Rust ReadingEvent V2 如何映射到 iOS UploadItem / API ReadingEvent 上传协议。 ## Rust 输出字段 - eventId - clientSessionId - materialId - eventType - position - activeSecondsDelta - timestampMs - sequence ## iOS 补充字段 - readingTargetType - platform - appVersion - clientTimezoneOffsetMinutes - knowledgeBaseId? ## API 解析字段 - userId - serverReceivedAt - status - errorCode - warningCodes ## 必须说明 1. Rust 不生成 readingTargetType。 2. Rust 不生成 userId。 3. timestampMs 在 iOS/API 侧转换为 clientTimestamp。 4. activeSecondsDelta 是唯一计时输入。 5. position 使用 camelCase JSON。 6. iOS ack 时机是本地队列写入成功,不是 API 上传成功。 ## 验收标准 1. 新增 docs/reading-event-v2-api-mapping.md。 2. 字段映射表完整。 3. 明确 Rust / iOS / API 的职责。 4. 明确不应把 readingTargetType 放回 Rust。 5. 明确 activeSecondsDelta 语义。 6. 可供 API / iOS 对齐使用。
wangdl added this to the M-DOC-FULL:Document Runtime 完整阅读内核与学习事件协议 milestone 2026-06-10 21:18:33 +08:00
Author
Owner

完成证据

产物: (50 行,已有)
已有提交: feat: DOC-FULL-003 ReadingEventV2

字段映射表:

Rust ReadingEventV2 iOS UploadItem API 来源
eventId eventId eventId Rust
clientSessionId clientSessionId clientSessionId Rust
materialId materialId materialId Rust
eventType eventType eventType Rust→iOS snake_case
position position position Rust (camelCase)
activeSecondsDelta activeSecondsDelta activeSecondsDelta Rust
timestampMs clientTimestamp clientTimestampMs Rust
sequence sequence sequence Rust
readingTargetType readingTargetType iOS 补充
platform platform iOS 补充
appVersion appVersion iOS 补充
clientTimezoneOffsetMinutes clientTimezoneOffsetMinutes iOS 补充
userId API 补充

核心原则: Rust 不生成 readingTargetType/userId, iOS ack 时机是本地队列写入成功, activeSecondsDelta 是唯一计时输入

## 完成证据 **产物**: (50 行,已有) **已有提交**: feat: DOC-FULL-003 ReadingEventV2 **字段映射表**: | Rust ReadingEventV2 | iOS UploadItem | API | 来源 | |---|---|---|---| | eventId | eventId | eventId | Rust | | clientSessionId | clientSessionId | clientSessionId | Rust | | materialId | materialId | materialId | Rust | | eventType | eventType | eventType | Rust→iOS snake_case | | position | position | position | Rust (camelCase) | | activeSecondsDelta | activeSecondsDelta | activeSecondsDelta | Rust | | timestampMs | clientTimestamp | clientTimestampMs | Rust | | sequence | sequence | sequence | Rust | | — | readingTargetType | readingTargetType | iOS 补充 | | — | platform | platform | iOS 补充 | | — | appVersion | appVersion | iOS 补充 | | — | clientTimezoneOffsetMinutes | clientTimezoneOffsetMinutes | iOS 补充 | | — | — | userId | API 补充 | **核心原则**: Rust 不生成 readingTargetType/userId, iOS ack 时机是本地队列写入成功, activeSecondsDelta 是唯一计时输入
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/zhixi-document-runtime#111
No description provided.