feat(data): add paywall payment APIs

This commit is contained in:
2026-06-18 12:53:06 +08:00
parent 567d3f9184
commit 35c30ac31e
38 changed files with 840 additions and 10 deletions
+11
View File
@@ -21,6 +21,8 @@ import {
ChatMessage,
ChatSendResponse,
SendMessageRequest,
UnlockPrivateRequest,
UnlockPrivateResponse,
} from "@/data/dto/chat";
import { Result } from "@/utils";
import type { IChatRepository } from "@/data/repositories/interfaces";
@@ -57,6 +59,15 @@ export class ChatRepository implements IChatRepository {
return Result.wrap(() => this.api.getHistory(limit, offset));
}
/** 解锁私密消息。 */
async unlockPrivateMessage(
messageId: string,
): Promise<Result<UnlockPrivateResponse>> {
return Result.wrap(() =>
this.api.unlockPrivateMessage(UnlockPrivateRequest.from({ messageId })),
);
}
// ============ 本地(Dexie)操作 ============
/** 把一条消息写入本地存储。 */