refactor(data): merge DTO models into schemas
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
FacebookIdentityResponse,
|
||||
FacebookPsidLoginResponse,
|
||||
LoginStatus,
|
||||
} from "@/data/dto/auth";
|
||||
} from "@/data/schemas/auth";
|
||||
import { AuthRepository } from "@/data/repositories/auth_repository";
|
||||
import type { AuthApi } from "@/data/services/api";
|
||||
import type { IAuthStorage } from "@/data/storage/auth";
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
LoginResponse,
|
||||
LoginStatus,
|
||||
RefreshTokenResponse,
|
||||
} from "@/data/dto/auth";
|
||||
} from "@/data/schemas/auth";
|
||||
import { AuthRepository } from "@/data/repositories/auth_repository";
|
||||
import type { AuthApi } from "@/data/services/api";
|
||||
import type { IAuthStorage } from "@/data/storage/auth";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { LoginStatus } from "@/data/dto/auth";
|
||||
import { LoginStatus } from "@/data/schemas/auth";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { ChatMessage } from "@/data/dto/chat";
|
||||
import { ChatMessage } from "@/data/schemas/chat";
|
||||
import { LocalMessage } from "@/data/storage/chat";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
import { ChatMessage, ChatSendResponse } from "@/data/dto/chat";
|
||||
import { ChatMessage, ChatSendResponse } from "@/data/schemas/chat";
|
||||
|
||||
import {
|
||||
buildChatMediaCacheKey,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { TipPaymentPlansResponse } from "@/data/dto/payment";
|
||||
import { TipPaymentPlansResponse } from "@/data/schemas/payment";
|
||||
import { PaymentRepository } from "@/data/repositories/payment_repository";
|
||||
import type { PaymentApi } from "@/data/services/api";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
RefreshTokenRequest,
|
||||
RefreshTokenResponse,
|
||||
RegisterRequest,
|
||||
} from "@/data/dto/auth";
|
||||
import { User } from "@/data/dto/user";
|
||||
} from "@/data/schemas/auth";
|
||||
import { User } from "@/data/schemas/user";
|
||||
import { AppEnvUtil } from "@/utils/app-env";
|
||||
import { PlatformDetector } from "@/utils/platform-detect";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CharactersResponse } from "@/data/dto/character";
|
||||
import type { CharactersResponse } from "@/data/schemas/character";
|
||||
import type { ICharacterRepository } from "@/data/repositories/interfaces";
|
||||
import { CharacterApi, characterApi } from "@/data/services/api/character_api";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LoginStatus } from "@/data/dto/auth";
|
||||
import { LoginStatus } from "@/data/schemas/auth";
|
||||
import { AuthStorage, type IAuthStorage } from "@/data/storage/auth";
|
||||
import { UserStorage, type IUserStorage } from "@/data/storage/user";
|
||||
import { Result, type Result as ResultT } from "@/utils/result";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChatMessage } from "@/data/dto/chat";
|
||||
import { ChatMessage } from "@/data/schemas/chat";
|
||||
import type { UnlockedPrivateMessageLocalPatch } from "@/data/repositories/interfaces";
|
||||
import { LocalChatStorage, LocalMessage } from "@/data/storage/chat";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChatMessage, ChatSendResponse } from "@/data/dto/chat";
|
||||
import type { ChatMessage, ChatSendResponse } from "@/data/schemas/chat";
|
||||
import {
|
||||
LocalChatMediaStorage,
|
||||
type LocalChatMediaRow,
|
||||
|
||||
@@ -2,7 +2,7 @@ import type {
|
||||
ChatMediaKind,
|
||||
ChatMessage,
|
||||
ChatSendResponse,
|
||||
} from "@/data/dto/chat";
|
||||
} from "@/data/schemas/chat";
|
||||
import type { CacheRemoteChatMediaInput } from "@/data/repositories/interfaces";
|
||||
import { isCacheableRemoteChatMediaUrl } from "@/lib/chat/chat_media_url";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
UnlockHistoryResponse,
|
||||
UnlockPrivateRequest,
|
||||
UnlockPrivateResponse,
|
||||
} from "@/data/dto/chat";
|
||||
} from "@/data/schemas/chat";
|
||||
import type { ChatApi } from "@/data/services/api";
|
||||
import type { UnlockPrivateMessageInput } from "@/data/repositories/interfaces";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
ChatSendResponse,
|
||||
UnlockHistoryResponse,
|
||||
UnlockPrivateResponse,
|
||||
} from "@/data/dto/chat";
|
||||
} from "@/data/schemas/chat";
|
||||
import { chatApi } from "@/data/services/api";
|
||||
import {
|
||||
LocalChatMediaStorage,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type {
|
||||
FeedbackSubmitResponse,
|
||||
SubmitFeedbackInput,
|
||||
} from "@/data/dto/feedback";
|
||||
} from "@/data/schemas/feedback";
|
||||
import type { IFeedbackRepository } from "@/data/repositories/interfaces";
|
||||
import { FeedbackApi, feedbackApi } from "@/data/services/api/feedback_api";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
@@ -17,8 +17,8 @@ import type {
|
||||
LoginStatus,
|
||||
LoginResponse,
|
||||
RefreshTokenResponse,
|
||||
} from "@/data/dto/auth";
|
||||
import type { User } from "@/data/dto/user";
|
||||
} from "@/data/schemas/auth";
|
||||
import type { User } from "@/data/schemas/user";
|
||||
|
||||
export interface IAuthRepository {
|
||||
/** 用户注册。注册成功不会自动登录(与 Dart 行为一致)。 */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CharactersResponse } from "@/data/dto/character";
|
||||
import type { CharactersResponse } from "@/data/schemas/character";
|
||||
import type { Result } from "@/utils/result";
|
||||
|
||||
export interface ICharacterRepository {
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
ChatSendResponse,
|
||||
UnlockHistoryResponse,
|
||||
UnlockPrivateResponse,
|
||||
} from "@/data/dto/chat";
|
||||
} from "@/data/schemas/chat";
|
||||
import type { ChatLockDetailData } from "@/data/schemas/chat";
|
||||
import type { ChatImageData, ChatLockType } from "@/data/schemas/chat";
|
||||
import type { LocalChatMediaRow } from "@/data/storage/chat";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type {
|
||||
FeedbackSubmitResponse,
|
||||
SubmitFeedbackInput,
|
||||
} from "@/data/dto/feedback";
|
||||
} from "@/data/schemas/feedback";
|
||||
import type { Result } from "@/utils/result";
|
||||
|
||||
export interface IFeedbackRepository {
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
PayChannel,
|
||||
PaymentOrderStatusResponse,
|
||||
PaymentPlansResponse,
|
||||
} from "@/data/dto/payment";
|
||||
} from "@/data/schemas/payment";
|
||||
import type { Result } from "@/utils/result";
|
||||
|
||||
export interface IPaymentRepository {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type {
|
||||
PrivateAlbumsResponse,
|
||||
PrivateAlbumUnlockResponse,
|
||||
} from "@/data/dto/private-room";
|
||||
} from "@/data/schemas/private-room";
|
||||
import type { Result } from "@/utils/result";
|
||||
|
||||
export interface GetPrivateAlbumsInput {
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Result } from "@/utils/result";
|
||||
import type {
|
||||
User,
|
||||
UserEntitlements,
|
||||
} from "@/data/dto/user";
|
||||
} from "@/data/schemas/user";
|
||||
|
||||
export interface IUserRepository {
|
||||
/** 获取当前登录用户信息。 */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* 指标/埋点仓库:纯远程 fire-and-forget 上报,无本地状态。
|
||||
*/
|
||||
import { MetricsApi, metricsApi } from "@/data/services/api";
|
||||
import { AppEvent, PwaEvent } from "@/data/dto/metrics";
|
||||
import { AppEvent, PwaEvent } from "@/data/schemas/metrics";
|
||||
import { Result } from "@/utils/result";
|
||||
import type { IMetricsRepository } from "@/data/repositories/interfaces";
|
||||
import { createLazySingleton } from "./lazy_singleton";
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
PayChannel,
|
||||
PaymentOrderStatusResponse,
|
||||
PaymentPlansResponse,
|
||||
} from "@/data/dto/payment";
|
||||
} from "@/data/schemas/payment";
|
||||
import { PaymentApi, paymentApi } from "@/data/services/api";
|
||||
import { PaymentPlansStorage } from "@/data/storage/payment";
|
||||
import type { IPaymentRepository } from "@/data/repositories/interfaces";
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
UnlockPrivateAlbumRequest,
|
||||
type PrivateAlbumsResponse,
|
||||
type PrivateAlbumUnlockResponse,
|
||||
} from "@/data/dto/private-room";
|
||||
} from "@/data/schemas/private-room";
|
||||
import {
|
||||
PrivateRoomApi,
|
||||
privateRoomApi,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { UserApi, userApi } from "@/data/services/api";
|
||||
import {
|
||||
User,
|
||||
UserEntitlements,
|
||||
} from "@/data/dto/user";
|
||||
} from "@/data/schemas/user";
|
||||
import { Result } from "@/utils/result";
|
||||
import type { IUserRepository } from "@/data/repositories/interfaces";
|
||||
import { createLazySingleton } from "./lazy_singleton";
|
||||
|
||||
Reference in New Issue
Block a user