refactor(dto): move app models into dto layer

This commit is contained in:
2026-06-17 17:34:55 +08:00
parent f0b5275c55
commit 5d66cef85c
24 changed files with 30 additions and 41 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* User 状态机:事件联合
*/
import type { UserView } from "@/models/user/user";
import type { UserView } from "@/data/dto/user";
export type UserEvent =
| { type: "UserInit" }
+2 -2
View File
@@ -14,7 +14,7 @@
import { fromPromise } from "xstate";
import type { UserView } from "@/models/user/user";
import type { UserView } from "@/data/dto/user";
import { userRepository } from "@/data/repositories/user_repository";
import { authRepository } from "@/data/repositories/auth_repository";
import type {
@@ -70,4 +70,4 @@ export const userFetchActor = fromPromise<UserView | null>(async () => {
*/
export const userLogoutActor = fromPromise<void>(async () => {
await authRepo.logout();
});
});
+2 -2
View File
@@ -13,7 +13,7 @@
* - machine 依赖 actorsimport)—— 不直接依赖 helpers
*/
import type { UserView } from "@/models/user/user";
import type { UserView } from "@/data/dto/user";
import { UserStorage } from "@/data/storage/user/user_storage";
import { Result } from "@/utils/result";
@@ -102,4 +102,4 @@ export async function readInitData(): Promise<InitData> {
}
return { user, avatarUrl };
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* User 状态机:State 形状 + 初始值
*/
import type { UserView } from "@/models/user/user";
import type { UserView } from "@/data/dto/user";
export interface UserState {
currentUser: UserView | null;