From 1af5780b1973c6c9102d7bd32078f24965f7d376 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 28 Dec 2025 00:02:18 -0800 Subject: [PATCH] =?UTF-8?q?fix(admin-service):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=85=B1=E7=AE=A1=E9=92=B1=E5=8C=85=20status=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B8=8D=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用 Prisma 生成的类型替代手动定义的接口: - PrismaCoManagedWalletSession -> @prisma/client - PrismaCoManagedWallet -> @prisma/client - status 字段使用 PrismaWalletSessionStatus 枚举类型 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../mappers/co-managed-wallet.mapper.ts | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts b/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts index 370aa5bb..4c794bb3 100644 --- a/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts +++ b/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts @@ -1,4 +1,9 @@ import { Injectable } from '@nestjs/common'; +import { + CoManagedWalletSession as PrismaSession, + CoManagedWallet as PrismaWallet, + WalletSessionStatus as PrismaWalletSessionStatus, +} from '@prisma/client'; import { CoManagedWalletSessionEntity, CoManagedWalletEntity, @@ -11,39 +16,14 @@ import { } from '../../../domain/enums/wallet-session-status.enum'; /** - * Prisma 会话模型类型 (需要在 schema.prisma 中定义) + * Prisma 会话模型类型 - 使用 Prisma 生成的类型 */ -export interface PrismaCoManagedWalletSession { - id: string; - walletName: string; - thresholdT: number; - thresholdN: number; - inviteCode: string; - status: string; - participants: string; // JSON string - currentRound: number; - totalRounds: number; - publicKey: string | null; - error: string | null; - createdAt: Date; - updatedAt: Date; - createdBy: string; -} +export type PrismaCoManagedWalletSession = PrismaSession; /** - * Prisma 钱包模型类型 + * Prisma 钱包模型类型 - 使用 Prisma 生成的类型 */ -export interface PrismaCoManagedWallet { - id: string; - sessionId: string; - name: string; - publicKey: string; - thresholdT: number; - thresholdN: number; - participants: string; // JSON string - createdAt: Date; - createdBy: string; -} +export type PrismaCoManagedWallet = PrismaWallet; @Injectable() export class CoManagedWalletMapper { @@ -94,7 +74,7 @@ export class CoManagedWalletMapper { thresholdT: domain.threshold.t, thresholdN: domain.threshold.n, inviteCode: domain.inviteCode, - status: domain.status, + status: domain.status as PrismaWalletSessionStatus, participants: JSON.stringify( domain.participants.map((p) => ({ partyId: p.partyId,