661e417619
- 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
35 lines
898 B
TypeScript
35 lines
898 B
TypeScript
/**
|
|
* 个性特征 DTO
|
|
*/
|
|
import {
|
|
PersonalityTraitsSchema,
|
|
type PersonalityTraitsInput,
|
|
type PersonalityTraitsData,
|
|
} from "@/data/services/schemas/user/personality_traits";
|
|
|
|
export class PersonalityTraits {
|
|
declare readonly cheerful: number;
|
|
declare readonly caring: number;
|
|
declare readonly playful: number;
|
|
declare readonly serious: number;
|
|
declare readonly romantic: number;
|
|
|
|
private constructor(input: PersonalityTraitsInput) {
|
|
const data = PersonalityTraitsSchema.parse(input);
|
|
Object.assign(this, data);
|
|
Object.freeze(this);
|
|
}
|
|
|
|
static from(input: PersonalityTraitsInput): PersonalityTraits {
|
|
return new PersonalityTraits(input);
|
|
}
|
|
|
|
static fromJson(json: unknown): PersonalityTraits {
|
|
return PersonalityTraits.from(json as PersonalityTraitsInput);
|
|
}
|
|
|
|
toJson(): PersonalityTraitsData {
|
|
return PersonalityTraitsSchema.parse(this);
|
|
}
|
|
}
|