refactor(data): replace schema classes with readonly models
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
import type {
|
||||
CacheRemoteChatMediaInput,
|
||||
ChatMediaLookupInput,
|
||||
IChatRepository,
|
||||
UnlockPrivateMessageInput,
|
||||
UnlockedPrivateMessageLocalPatch,
|
||||
} from "@/data/repositories/interfaces";
|
||||
import type {
|
||||
ChatHistoryResponse,
|
||||
ChatMessage,
|
||||
@@ -11,13 +18,6 @@ import {
|
||||
LocalChatStorage,
|
||||
type LocalChatMediaRow,
|
||||
} from "@/data/storage/chat";
|
||||
import type {
|
||||
CacheRemoteChatMediaInput,
|
||||
ChatMediaLookupInput,
|
||||
IChatRepository,
|
||||
UnlockPrivateMessageInput,
|
||||
UnlockedPrivateMessageLocalPatch,
|
||||
} from "@/data/repositories/interfaces";
|
||||
import type { Result } from "@/utils/result";
|
||||
|
||||
import { ChatLocalMessageStore } from "./chat_local_message_store";
|
||||
@@ -60,7 +60,9 @@ export class ChatRepository implements IChatRepository {
|
||||
}
|
||||
|
||||
/** 一键解锁历史锁定消息。 */
|
||||
async unlockHistory(characterId: string): Promise<Result<UnlockHistoryResponse>> {
|
||||
async unlockHistory(
|
||||
characterId: string,
|
||||
): Promise<Result<UnlockHistoryResponse>> {
|
||||
return this.remote.unlockHistory(characterId);
|
||||
}
|
||||
|
||||
@@ -101,7 +103,7 @@ export class ChatRepository implements IChatRepository {
|
||||
/** 读取所有本地消息,按 dbId 升序。 */
|
||||
async getLocalMessages(
|
||||
cacheIdentity?: string,
|
||||
): Promise<Result<ChatMessage[]>> {
|
||||
): Promise<Result<readonly ChatMessage[]>> {
|
||||
return this.localMessages.getMessages(cacheIdentity);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user