feat(chat): sync multi-role backend APIs

This commit is contained in:
2026-07-20 11:29:54 +08:00
parent 16b5c16e76
commit b6fdc912ae
84 changed files with 1488 additions and 439 deletions
@@ -0,0 +1,6 @@
import type { CharacterListResponse } from "@/data/schemas/character";
import type { Result } from "@/utils/result";
export interface ICharacterRepository {
getChatCharacters(): Promise<Result<CharacterListResponse>>;
}
@@ -6,6 +6,8 @@
import type {
ChatHistoryResponse,
ChatPreviewsResponse,
ChatSyncRequest,
ChatImageData,
ChatLockDetailData,
ChatLockType,
@@ -47,7 +49,12 @@ export interface ChatRequestOptions {
}
export interface ChatSendOptions extends ChatRequestOptions {
image?: string;
imageId?: string;
imageThumbUrl?: string;
imageMediumUrl?: string;
imageOriginalUrl?: string;
imageWidth?: number;
imageHeight?: number;
useWebSocket?: boolean;
}
@@ -67,6 +74,17 @@ export interface IChatRepository {
options?: ChatRequestOptions,
): Promise<Result<ChatHistoryResponse>>;
/** 批量获取所有可聊天角色的最新消息。 */
getPreviews(
options?: ChatRequestOptions,
): Promise<Result<ChatPreviewsResponse>>;
/** 把一个角色的游客历史同步到正式账号。 */
syncGuestHistory(
request: ChatSyncRequest,
options?: ChatRequestOptions,
): Promise<Result<void>>;
/** 解锁单条历史付费 / 私密消息。 */
unlockPrivateMessage(
input: UnlockPrivateMessageInput,
@@ -4,6 +4,7 @@
export * from "./iauth_repository";
export * from "./ichat_repository";
export * from "./icharacter_repository";
export * from "./ifeedback_repository";
export * from "./imetrics_repository";
export * from "./ipayment_repository";
@@ -5,13 +5,13 @@ import type {
import type { Result } from "@/utils/result";
export interface GetPrivateAlbumsInput {
characterId?: string;
characterId: string;
limit?: number;
}
export interface IPrivateRoomRepository {
getAlbums(
input?: GetPrivateAlbumsInput,
input: GetPrivateAlbumsInput,
): Promise<Result<PrivateAlbumsResponse>>;
unlockAlbum(