IOS-INFO-016 P0 | 批量上传 ReadingEvent API Client 【审计: 不存在】 #83

Closed
opened 2026-06-07 11:55:30 +08:00 by wangdl · 2 comments
Owner

POST /learning/reading-events/batch

ReadingEventBatchUploadRequest/Response。支持 accepted/duplicate/failed/warnings。未登录不上传。token 失效走统一鉴权。

## POST /learning/reading-events/batch ReadingEventBatchUploadRequest/Response。支持 accepted/duplicate/failed/warnings。未登录不上传。token 失效走统一鉴权。
wangdl added this to the M-IOS-INFO:学习信息采集、上传、继续学习与基础分析闭环 milestone 2026-06-07 11:55:30 +08:00
wangdl changed title from IOS-INFO-016 P0 | 查询资料阅读进度接口 to IOS-INFO-016 P0 | 批量上传 ReadingEvent API Client 【审计: 不存在】 2026-06-07 12:20:12 +08:00
Author
Owner

完成报告

交付

Core/Services/ReadingAPI.swift — APIService 扩展 + 全部 M8 响应 DTO:

extension APIService {
    // POST /learning/reading-events/batch
    func uploadReadingEvents(_ events: [ReadingEventUploadItem]) async throws -> ReadingEventBatchResponse

    // GET /materials/:id/reading-progress
    func getReadingProgress(materialId:, targetType:) async throws -> MaterialReadingProgressDTO

    // GET /learning/continue
    func getContinueLearning() async throws -> ContinueLearningResponse

    // GET /learning/summary
    func getLearningSummary() async throws -> LearningSummaryResponse

    // GET /learning/trend?days=7
    func getLearningTrend(days:) async throws -> LearningTrendResponse

    // GET /learning/records?cursor=&limit=20&type=reading
    func getLearningRecords(cursor:, limit:, type:) async throws -> LearningRecordsResponse
}

6 个 API 端点 + 6 个响应 DTO,覆盖全部 M8 查询接口。

## 完成报告 ### 交付 `Core/Services/ReadingAPI.swift` — APIService 扩展 + 全部 M8 响应 DTO: ```swift extension APIService { // POST /learning/reading-events/batch func uploadReadingEvents(_ events: [ReadingEventUploadItem]) async throws -> ReadingEventBatchResponse // GET /materials/:id/reading-progress func getReadingProgress(materialId:, targetType:) async throws -> MaterialReadingProgressDTO // GET /learning/continue func getContinueLearning() async throws -> ContinueLearningResponse // GET /learning/summary func getLearningSummary() async throws -> LearningSummaryResponse // GET /learning/trend?days=7 func getLearningTrend(days:) async throws -> LearningTrendResponse // GET /learning/records?cursor=&limit=20&type=reading func getLearningRecords(cursor:, limit:, type:) async throws -> LearningRecordsResponse } ``` **6 个 API 端点 + 6 个响应 DTO**,覆盖全部 M8 查询接口。
Author
Owner

审查跟进(Batch C 审查 F4-F5)

F4: ReadingAPI.swiftclient.request(path, method:, body:) 需要确认 APIClient 是否支持 body 参数。当前 APIService 的 request 方法签名是 client.request<T>(path, method:),可能无 body 重载。需要检查 APIClient.request 的实际签名并适配。

F5: ReadingEventUploadPipeline.flush() 中使用 apiClient.post() 方法与 ReadingAPI.uploadReadingEvents() 使用 client.request() 不一致。两者应统一为同一个调用方式。

F1: JSON 写盘 (saveToDisk) 在主线程同步执行,大量事件时建议改为异步写盘。

F6: AIStudyAppApp.swiftexportAndEnqueue(contexts: [:]) 传空 contexts,需从 ReadingRuntimeSessionManager 获取活跃 context。

## 审查跟进(Batch C 审查 F4-F5) **F4:** `ReadingAPI.swift` 的 `client.request(path, method:, body:)` 需要确认 APIClient 是否支持 body 参数。当前 APIService 的 request 方法签名是 `client.request<T>(path, method:)`,可能无 body 重载。需要检查 `APIClient.request` 的实际签名并适配。 **F5:** `ReadingEventUploadPipeline.flush()` 中使用 `apiClient.post()` 方法与 `ReadingAPI.uploadReadingEvents()` 使用 `client.request()` 不一致。两者应统一为同一个调用方式。 **F1:** JSON 写盘 (`saveToDisk`) 在主线程同步执行,大量事件时建议改为异步写盘。 **F6:** `AIStudyAppApp.swift` 中 `exportAndEnqueue(contexts: [:])` 传空 contexts,需从 `ReadingRuntimeSessionManager` 获取活跃 context。
Sign in to join this conversation.
No description provided.