refactor(dto): group request and response models
Docker Image / Build and Push Docker Image (push) Successful in 2m50s
Docker Image / Build and Push Docker Image (push) Successful in 2m50s
This commit is contained in:
@@ -4,16 +4,7 @@
|
|||||||
|
|
||||||
export * from "./auth_mode";
|
export * from "./auth_mode";
|
||||||
export * from "./auth_panel_mode";
|
export * from "./auth_panel_mode";
|
||||||
export * from "./facebook_login_request";
|
|
||||||
export * from "./facebook_user_data";
|
export * from "./facebook_user_data";
|
||||||
export * from "./fb_id_login_request";
|
|
||||||
export * from "./google_login_request";
|
|
||||||
export * from "./guest_login_request";
|
|
||||||
export * from "./guest_login_response";
|
|
||||||
export * from "./login_request";
|
|
||||||
export * from "./login_response";
|
|
||||||
export * from "./login_status";
|
export * from "./login_status";
|
||||||
export * from "./logout_response";
|
export * from "./request";
|
||||||
export * from "./refresh_token_request";
|
export * from "./response";
|
||||||
export * from "./refresh_token_response";
|
|
||||||
export * from "./register_request";
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export * from "./facebook_login_request";
|
||||||
|
export * from "./fb_id_login_request";
|
||||||
|
export * from "./google_login_request";
|
||||||
|
export * from "./guest_login_request";
|
||||||
|
export * from "./login_request";
|
||||||
|
export * from "./refresh_token_request";
|
||||||
|
export * from "./register_request";
|
||||||
-3
@@ -10,10 +10,7 @@ import { User } from "@/data/dto/user/user";
|
|||||||
|
|
||||||
export class GuestLoginResponse {
|
export class GuestLoginResponse {
|
||||||
declare readonly token: string;
|
declare readonly token: string;
|
||||||
declare readonly deviceId: string;
|
|
||||||
declare readonly userId: string;
|
declare readonly userId: string;
|
||||||
declare readonly isDeviceUser: boolean;
|
|
||||||
declare readonly expiresIn: number;
|
|
||||||
declare readonly user: User;
|
declare readonly user: User;
|
||||||
|
|
||||||
private constructor(input: GuestLoginResponseInput) {
|
private constructor(input: GuestLoginResponseInput) {
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export * from "./guest_login_response";
|
||||||
|
export * from "./login_response";
|
||||||
|
export * from "./logout_response";
|
||||||
|
export * from "./refresh_token_response";
|
||||||
-1
@@ -10,7 +10,6 @@ import {
|
|||||||
export class RefreshTokenResponse {
|
export class RefreshTokenResponse {
|
||||||
declare readonly token: string;
|
declare readonly token: string;
|
||||||
declare readonly refreshToken: string;
|
declare readonly refreshToken: string;
|
||||||
declare readonly userId: string;
|
|
||||||
|
|
||||||
private constructor(input: RefreshTokenResponseInput) {
|
private constructor(input: RefreshTokenResponseInput) {
|
||||||
const data = RefreshTokenResponseSchema.parse(input);
|
const data = RefreshTokenResponseSchema.parse(input);
|
||||||
@@ -2,13 +2,9 @@
|
|||||||
* @file Automatically generated by barrelsby.
|
* @file Automatically generated by barrelsby.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from "./chat_history_response";
|
|
||||||
export * from "./chat_list_item";
|
export * from "./chat_list_item";
|
||||||
export * from "./chat_media";
|
export * from "./chat_media";
|
||||||
export * from "./chat_message";
|
export * from "./chat_message";
|
||||||
export * from "./chat_send_response";
|
export * from "./request";
|
||||||
export * from "./send_message_request";
|
export * from "./response";
|
||||||
export * from "./ui_message";
|
export * from "./ui_message";
|
||||||
export * from "./unlock_history_response";
|
|
||||||
export * from "./unlock_private_request";
|
|
||||||
export * from "./unlock_private_response";
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./send_message_request";
|
||||||
|
export * from "./unlock_private_request";
|
||||||
+1
-8
@@ -6,17 +6,10 @@ import {
|
|||||||
type ChatHistoryResponseInput,
|
type ChatHistoryResponseInput,
|
||||||
type ChatHistoryResponseData,
|
type ChatHistoryResponseData,
|
||||||
} from "@/data/schemas/chat/chat_history_response";
|
} from "@/data/schemas/chat/chat_history_response";
|
||||||
import { ChatMessage } from "./chat_message";
|
import { ChatMessage } from "../chat_message";
|
||||||
|
|
||||||
export class ChatHistoryResponse {
|
export class ChatHistoryResponse {
|
||||||
declare readonly messages: ChatMessage[];
|
declare readonly messages: ChatMessage[];
|
||||||
declare readonly total: number;
|
|
||||||
declare readonly limit: number;
|
|
||||||
declare readonly offset: number;
|
|
||||||
declare readonly isVip: boolean;
|
|
||||||
declare readonly privateFreeLimit: number;
|
|
||||||
declare readonly privateUsedToday: number;
|
|
||||||
declare readonly privateCanViewFree: boolean;
|
|
||||||
|
|
||||||
private constructor(input: ChatHistoryResponseInput) {
|
private constructor(input: ChatHistoryResponseInput) {
|
||||||
const data = ChatHistoryResponseSchema.parse(input);
|
const data = ChatHistoryResponseSchema.parse(input);
|
||||||
-1
@@ -13,7 +13,6 @@ export class ChatSendResponse {
|
|||||||
declare readonly reply: string;
|
declare readonly reply: string;
|
||||||
declare readonly audioUrl: string;
|
declare readonly audioUrl: string;
|
||||||
declare readonly messageId: string;
|
declare readonly messageId: string;
|
||||||
declare readonly isGuest: boolean;
|
|
||||||
declare readonly timestamp: number;
|
declare readonly timestamp: number;
|
||||||
declare readonly image: ChatImageData;
|
declare readonly image: ChatImageData;
|
||||||
declare readonly lockDetail: ChatLockDetailData;
|
declare readonly lockDetail: ChatLockDetailData;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export * from "./chat_history_response";
|
||||||
|
export * from "./chat_send_response";
|
||||||
|
export * from "./unlock_history_response";
|
||||||
|
export * from "./unlock_private_response";
|
||||||
-10
@@ -11,17 +11,7 @@ import {
|
|||||||
export class UnlockHistoryResponse {
|
export class UnlockHistoryResponse {
|
||||||
declare readonly unlocked: boolean;
|
declare readonly unlocked: boolean;
|
||||||
declare readonly reason: UnlockHistoryReason;
|
declare readonly reason: UnlockHistoryReason;
|
||||||
declare readonly totalLocked: number;
|
|
||||||
declare readonly unlockedCount: number;
|
|
||||||
declare readonly privateCount: number;
|
|
||||||
declare readonly imageCount: number;
|
|
||||||
declare readonly voiceCount: number;
|
|
||||||
declare readonly requiredCredits: number;
|
|
||||||
declare readonly currentCredits: number;
|
|
||||||
declare readonly remainingCredits: number;
|
|
||||||
declare readonly shortfallCredits: number;
|
declare readonly shortfallCredits: number;
|
||||||
declare readonly costsByMessage: Record<string, number>;
|
|
||||||
declare readonly messageIds: string[];
|
|
||||||
|
|
||||||
private constructor(input: UnlockHistoryResponseInput) {
|
private constructor(input: UnlockHistoryResponseInput) {
|
||||||
const data = UnlockHistoryResponseSchema.parse(input);
|
const data = UnlockHistoryResponseSchema.parse(input);
|
||||||
@@ -2,5 +2,4 @@
|
|||||||
* @file Automatically generated by barrelsby.
|
* @file Automatically generated by barrelsby.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from "./app_event";
|
export * from "./request";
|
||||||
export * from "./pwa_event";
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./app_event";
|
||||||
|
export * from "./pwa_event";
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
* @file Payment DTO barrel.
|
* @file Payment DTO barrel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from "./create_payment_order_request";
|
|
||||||
export * from "./create_payment_order_response";
|
|
||||||
export * from "./payment_order_status_response";
|
|
||||||
export * from "./payment_plan";
|
export * from "./payment_plan";
|
||||||
export * from "./payment_plans_response";
|
export * from "./request";
|
||||||
|
export * from "./response";
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from "./create_payment_order_request";
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export * from "./create_payment_order_response";
|
||||||
|
export * from "./payment_order_status_response";
|
||||||
|
export * from "./payment_plans_response";
|
||||||
-3
@@ -11,10 +11,7 @@ import {
|
|||||||
export type { PaymentOrderStatus };
|
export type { PaymentOrderStatus };
|
||||||
|
|
||||||
export class PaymentOrderStatusResponse {
|
export class PaymentOrderStatusResponse {
|
||||||
declare readonly orderId: string;
|
|
||||||
declare readonly status: PaymentOrderStatus;
|
declare readonly status: PaymentOrderStatus;
|
||||||
declare readonly orderType: string;
|
|
||||||
declare readonly planId: string;
|
|
||||||
|
|
||||||
private constructor(input: PaymentOrderStatusResponseInput) {
|
private constructor(input: PaymentOrderStatusResponseInput) {
|
||||||
const data = PaymentOrderStatusResponseSchema.parse(input);
|
const data = PaymentOrderStatusResponseSchema.parse(input);
|
||||||
+1
-1
@@ -8,7 +8,7 @@ import {
|
|||||||
type PaymentPlansResponseInput,
|
type PaymentPlansResponseInput,
|
||||||
} from "@/data/schemas/payment/payment_plans_response";
|
} from "@/data/schemas/payment/payment_plans_response";
|
||||||
|
|
||||||
import { PaymentPlan } from "./payment_plan";
|
import { PaymentPlan } from "../payment_plan";
|
||||||
|
|
||||||
export class PaymentPlansResponse {
|
export class PaymentPlansResponse {
|
||||||
declare readonly isFirstRecharge: boolean;
|
declare readonly isFirstRecharge: boolean;
|
||||||
+16
-16
@@ -16,24 +16,24 @@ export * from "../../core/net/interceptor/auth_refresh_interceptor";
|
|||||||
export * from "../../core/net/interceptor/logging_interceptor";
|
export * from "../../core/net/interceptor/logging_interceptor";
|
||||||
export * from "../../core/net/interceptor/token_interceptor";
|
export * from "../../core/net/interceptor/token_interceptor";
|
||||||
// 注:原 ./auth/* 平台适配层已删除(社交登录改由 NextAuth 处理)
|
// 注:原 ./auth/* 平台适配层已删除(社交登录改由 NextAuth 处理)
|
||||||
export * from "../dto/auth/facebook_login_request";
|
|
||||||
export * from "../dto/auth/facebook_user_data";
|
export * from "../dto/auth/facebook_user_data";
|
||||||
export * from "../dto/auth/fb_id_login_request";
|
export * from "../dto/auth/request/facebook_login_request";
|
||||||
export * from "../dto/auth/google_login_request";
|
export * from "../dto/auth/request/fb_id_login_request";
|
||||||
export * from "../dto/auth/guest_login_request";
|
export * from "../dto/auth/request/google_login_request";
|
||||||
export * from "../dto/auth/guest_login_response";
|
export * from "../dto/auth/request/guest_login_request";
|
||||||
export * from "../dto/auth/login_request";
|
export * from "../dto/auth/request/login_request";
|
||||||
export * from "../dto/auth/login_response";
|
export * from "../dto/auth/request/refresh_token_request";
|
||||||
export * from "../dto/auth/logout_response";
|
export * from "../dto/auth/request/register_request";
|
||||||
export * from "../dto/auth/refresh_token_request";
|
export * from "../dto/auth/response/guest_login_response";
|
||||||
export * from "../dto/auth/refresh_token_response";
|
export * from "../dto/auth/response/login_response";
|
||||||
export * from "../dto/auth/register_request";
|
export * from "../dto/auth/response/logout_response";
|
||||||
export * from "../dto/chat/chat_history_response";
|
export * from "../dto/auth/response/refresh_token_response";
|
||||||
export * from "../dto/chat/chat_message";
|
export * from "../dto/chat/chat_message";
|
||||||
export * from "../dto/chat/chat_send_response";
|
export * from "../dto/chat/request/send_message_request";
|
||||||
export * from "../dto/chat/send_message_request";
|
export * from "../dto/chat/response/chat_history_response";
|
||||||
export * from "../dto/metrics/app_event";
|
export * from "../dto/chat/response/chat_send_response";
|
||||||
export * from "../dto/metrics/pwa_event";
|
export * from "../dto/metrics/request/app_event";
|
||||||
|
export * from "../dto/metrics/request/pwa_event";
|
||||||
export * from "../dto/user/avatar_data";
|
export * from "../dto/user/avatar_data";
|
||||||
export * from "../dto/user/personality_traits";
|
export * from "../dto/user/personality_traits";
|
||||||
export * from "../dto/user/recent_memory";
|
export * from "../dto/user/recent_memory";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
import { ChatSendResponse } from "@/data/dto/chat/chat_send_response";
|
import { ChatSendResponse } from "@/data/dto/chat";
|
||||||
import type { ChatState } from "@/stores/chat/chat-state";
|
import type { ChatState } from "@/stores/chat/chat-state";
|
||||||
import {
|
import {
|
||||||
applyHttpSendOutput,
|
applyHttpSendOutput,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { UiMessage } from "@/data/dto/chat";
|
import { type ChatSendResponse, type UiMessage } from "@/data/dto/chat";
|
||||||
import { ChatSendResponse } from "@/data/dto/chat/chat_send_response";
|
|
||||||
import { todayString } from "@/utils";
|
import { todayString } from "@/utils";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { UiMessage } from "@/data/dto/chat";
|
import { type ChatSendResponse, type UiMessage } from "@/data/dto/chat";
|
||||||
import { ChatSendResponse } from "@/data/dto/chat/chat_send_response";
|
|
||||||
|
|
||||||
import type { ChatState, ChatUpgradeReason } from "./chat-state";
|
import type { ChatState, ChatUpgradeReason } from "./chat-state";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user