Fix: 小修小补 & 优化代码结构

This commit is contained in:
2025-08-16 17:13:51 +08:00
parent eaf7d3be38
commit c3964b8e35
6 changed files with 83 additions and 69 deletions

View File

@ -0,0 +1,41 @@
export interface StrapiEntity {
id?: number;
documentId?: string;
createdAt?: string;
updatedAt?: string;
publishedAt?: string;
locale?: string;
}
export interface StrapiImage {
id: number;
url: string;
alternativeText?: string;
caption?: string;
width?: number;
height?: number;
formats?: {
small?: StrapiImageFormat;
medium?: StrapiImageFormat;
thumbnail?: StrapiImageFormat;
}
}
export interface StrapiImageFormat {
url: string;
width: number;
height: number;
size: number;
}
export interface StrapiResponse<T> {
data: T;
meta?: {
pagination?: {
page: number;
pageSize: number;
pageCount: number;
total: number;
}
}
}

View File

@ -0,0 +1,2 @@
export * from './common';
export * from './production';

View File

@ -0,0 +1,14 @@
import type { StrapiEntity, StrapiImage } from './common';
export interface ProductionType extends StrapiEntity {
type: string;
}
export interface Production extends StrapiEntity {
title: string;
summary?: string;
production_type?: ProductionType;
production_image?: StrapiImage;
production_details?: string;
production_specs?: string | object;
}