refactor(dto): group request and response models
Docker Image / Build and Push Docker Image (push) Successful in 2m50s

This commit is contained in:
2026-07-07 16:43:08 +08:00
parent b5bf81de59
commit 9cb9534459
38 changed files with 51 additions and 71 deletions
@@ -0,0 +1,33 @@
/**
* Google 登录请求 DTO
*/
import {
GoogleLoginRequestSchema,
type GoogleLoginRequestInput,
type GoogleLoginRequestData,
} from "@/data/schemas/auth/google_login_request";
export class GoogleLoginRequest {
declare readonly idToken: string;
declare readonly platform: string;
declare readonly guestId: string;
declare readonly isTestAccount: boolean;
private constructor(input: GoogleLoginRequestInput) {
const data = GoogleLoginRequestSchema.parse(input);
Object.assign(this, data);
Object.freeze(this);
}
static from(input: GoogleLoginRequestInput): GoogleLoginRequest {
return new GoogleLoginRequest(input);
}
static fromJson(json: unknown): GoogleLoginRequest {
return GoogleLoginRequest.from(json as GoogleLoginRequestInput);
}
toJson(): GoogleLoginRequestData {
return GoogleLoginRequestSchema.parse(this);
}
}