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
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
/**
|
||||
* 图片上传响应 DTO
|
||||
*/
|
||||
import {
|
||||
ImageUploadResponseSchema,
|
||||
type ImageUploadResponseInput,
|
||||
type ImageUploadResponseData,
|
||||
} from "@/data/schemas/chat/image_upload_response";
|
||||
|
||||
export class ImageUploadResponse {
|
||||
declare readonly success: boolean;
|
||||
declare readonly imageId: string;
|
||||
declare readonly thumbUrl: string;
|
||||
declare readonly mediumUrl: string;
|
||||
declare readonly originalUrl: string;
|
||||
declare readonly width: number;
|
||||
declare readonly height: number;
|
||||
declare readonly bytes: number;
|
||||
|
||||
private constructor(input: ImageUploadResponseInput) {
|
||||
const data = ImageUploadResponseSchema.parse(input);
|
||||
Object.assign(this, data);
|
||||
Object.freeze(this);
|
||||
}
|
||||
|
||||
static from(input: ImageUploadResponseInput): ImageUploadResponse {
|
||||
return new ImageUploadResponse(input);
|
||||
}
|
||||
|
||||
static fromJson(json: unknown): ImageUploadResponse {
|
||||
return ImageUploadResponse.from(json as ImageUploadResponseInput);
|
||||
}
|
||||
|
||||
toJson(): ImageUploadResponseData {
|
||||
return ImageUploadResponseSchema.parse(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user