refactor(utils): add barrel exports

This commit is contained in:
2026-06-18 11:58:50 +08:00
parent 428402d4b1
commit 0d0dabaace
34 changed files with 48 additions and 51 deletions
+1 -2
View File
@@ -16,8 +16,7 @@
* - `recordXxx(today)` 写入 todayString,后续 `canXxx` 在同一天返回 `false`。
*/
import { Result, type Result as ResultT } from "@/utils/result";
import { SpAsyncUtil } from "@/utils/storage";
import { Result, type Result as ResultT, SpAsyncUtil } from "@/utils";
import { StorageKeys } from "../storage_keys";
export class AppStorage {
+1 -2
View File
@@ -14,8 +14,7 @@
* - `clearAuthData` 顺序清理:loginToken → guestToken → refreshToken,任一失败立即返回
*/
import { Result, type Result as ResultT } from "@/utils/result";
import { SpAsyncUtil } from "@/utils/storage";
import { Result, type Result as ResultT, SpAsyncUtil } from "@/utils";
import { StorageKeys } from "../storage_keys";
import type { IAuthStorage } from "./iauth_storage";
+1 -1
View File
@@ -9,7 +9,7 @@
* - 所有方法返回 `Promise<Result<T>>`,与 Dart `Future<Result<T>>` 对齐
*/
import type { Result } from "@/utils/result";
import type { Result } from "@/utils";
export interface IAuthStorage {
getLoginToken(): Promise<Result<string | null>>;
@@ -4,8 +4,7 @@ import memoryDriver from "unstorage/drivers/memory";
import { GuestChatQuota } from "@/data/dto/chat/guest_chat_quota";
import { StorageKeys } from "@/data/storage/storage_keys";
import { todayString } from "@/utils/date";
import { SpAsyncUtil } from "@/utils/storage";
import { todayString, SpAsyncUtil } from "@/utils";
import { ChatStorage } from "../chat_storage";
+1 -3
View File
@@ -7,9 +7,7 @@ import {
import { GuestChatQuota as GuestChatQuotaDto } from "@/data/dto/chat/guest_chat_quota";
import { z } from "zod";
import { type Result as ResultT, Result } from "@/utils/result";
import { todayString } from "@/utils/date";
import { SpAsyncUtil } from "@/utils/storage";
import { type Result as ResultT, Result, todayString, SpAsyncUtil } from "@/utils";
import { StorageKeys } from "../storage_keys";
import type { IChatStorage } from "./ichat_storage";
+1 -1
View File
@@ -11,7 +11,7 @@
* 跨天判断逻辑(`needsReset`)保留在 `GuestChatQuota` 类上。
*/
import type { Result } from "@/utils/result";
import type { Result } from "@/utils";
import type { GuestChatQuotaData } from "@/data/schemas/chat/guest_chat_quota";
export interface IChatStorage {
+1 -1
View File
@@ -15,7 +15,7 @@
* 数据量大时考虑升级 schema 加索引。
*/
import { Result, type Result as ResultT } from "@/utils/result";
import { Result, type Result as ResultT } from "@/utils";
import { LocalChatDB } from "./local_chat_db";
import { LocalMessage } from "./local_message";
+1 -1
View File
@@ -11,7 +11,7 @@
* 具体序列化由实现层通过 Zod schema 校验后转换为 `User` 类实例。
*/
import type { Result } from "@/utils/result";
import type { Result } from "@/utils";
import type { UserData } from "@/data/schemas/user/user";
export interface IUserStorage {
+1 -2
View File
@@ -16,8 +16,7 @@
*/
import { UserSchema, type UserData } from "@/data/schemas/user/user";
import { type Result as ResultT } from "@/utils/result";
import { SpAsyncUtil } from "@/utils/storage";
import { type Result as ResultT, SpAsyncUtil } from "@/utils";
import { StorageKeys } from "../storage_keys";
import type { IUserStorage } from "./iuser_storage";