feat(data): add paywall payment APIs
This commit is contained in:
@@ -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)操作 ============
|
||||
|
||||
/** 把一条消息写入本地存储。 */
|
||||
|
||||
Reference in New Issue
Block a user