Files
cozsweet-frontend-nextjs/src/data/services/dto/user/update_profile_request.ts
T
admin 661e417619 refactor(data): consolidate data layer under services namespace
- Move src/data/{api,dto,schemas} directories to src/data/services/*
- Update all relative imports across the codebase to reference new paths
- Use CSS color tokens for splash button gradient in splash-button.module.css
- Add responsive sizes attribute to splash background image
- Add JSDoc documentation to splash-background component referencing original Dart implementation
2026-06-09 16:44:05 +08:00

34 lines
935 B
TypeScript

/**
* 更新个人资料请求 DTO
*/
import {
UpdateProfileRequestSchema,
type UpdateProfileRequestInput,
type UpdateProfileRequestData,
} from "@/data/services/schemas/user/update_profile_request";
export class UpdateProfileRequest {
declare readonly username: string;
declare readonly nickname: string;
declare readonly preferredLanguage: string;
declare readonly currentMood: string;
private constructor(input: UpdateProfileRequestInput) {
const data = UpdateProfileRequestSchema.parse(input);
Object.assign(this, data);
Object.freeze(this);
}
static from(input: UpdateProfileRequestInput): UpdateProfileRequest {
return new UpdateProfileRequest(input);
}
static fromJson(json: unknown): UpdateProfileRequest {
return UpdateProfileRequest.from(json as UpdateProfileRequestInput);
}
toJson(): UpdateProfileRequestData {
return UpdateProfileRequestSchema.parse(this);
}
}