Files
Genarrative/server-node/src/repositories/rpg-entry/RpgSaveArchiveRepository.ts
2026-04-21 18:27:46 +08:00

37 lines
1.1 KiB
TypeScript

import type {
RuntimeRepositoryPort,
SavedSnapshot,
} from '../runtimeRepository.js';
import type { ProfileSaveArchiveSummary } from '../../../../packages/shared/src/contracts/runtime.js';
/**
* RPG 继续游戏归档仓储端口。
* 当前仍由 runtimeRepository 提供真实实现,本文件只建立按领域命名的兼容入口。
*/
export type RpgSaveArchiveRepositoryPort = Pick<
RuntimeRepositoryPort,
'listProfileSaveArchives' | 'resumeProfileSaveArchive'
>;
export type RpgSaveArchiveSnapshot = SavedSnapshot;
export class RpgSaveArchiveRepository implements RpgSaveArchiveRepositoryPort {
constructor(private readonly runtimeRepository: RuntimeRepositoryPort) {}
listProfileSaveArchives(userId: string): Promise<ProfileSaveArchiveSummary[]> {
return this.runtimeRepository.listProfileSaveArchives(userId);
}
resumeProfileSaveArchive(
userId: string,
worldKey: string,
): Promise<
| {
entry: ProfileSaveArchiveSummary;
snapshot: RpgSaveArchiveSnapshot;
}
| null
> {
return this.runtimeRepository.resumeProfileSaveArchive(userId, worldKey);
}
}