refactor: 修复 modules 三层架构违规

- auth: actionDeleteAccount 改用 service+repo,forgot-password 完整三层实现
- card: serviceCheckCardOwnership 替代直接调用 repository
- deck: 移除 service 层的 use server 指令
- dictionary: 数据转换逻辑从 repository 移到 service
- ocr: 认证移到 action 层,跨模块调用改用 service
- translator: genIPA/genLanguage 改用 service 层
This commit is contained in:
2026-03-11 09:40:53 +08:00
parent e68e24a9fb
commit 804c28ada9
34 changed files with 599 additions and 235 deletions

View File

@@ -1,15 +1,18 @@
import { auth } from "@/auth";
import {
repoFindUserByUsername,
repoFindUserById
repoFindUserById,
repoDeleteUserCascade
} from "./auth-repository";
import {
ServiceInputGetUserProfileByUsername,
ServiceInputGetUserProfileById,
ServiceInputSignIn,
ServiceInputSignUp,
ServiceInputDeleteAccount,
ServiceOutputAuth,
ServiceOutputUserProfile
ServiceOutputUserProfile,
ServiceOutputDeleteAccount
} from "./auth-service-dto";
/**
@@ -92,3 +95,7 @@ export async function serviceGetUserProfileByUsername(dto: ServiceInputGetUserPr
export async function serviceGetUserProfileById(dto: ServiceInputGetUserProfileById): Promise<ServiceOutputUserProfile> {
return await repoFindUserById(dto);
}
export async function serviceDeleteAccount(dto: ServiceInputDeleteAccount): Promise<ServiceOutputDeleteAccount> {
return await repoDeleteUserCascade({ userId: dto.userId });
}