feat!: 将项目有Strapi迁移至Directus #43

Manually merged
remilia merged 30 commits from feat/directus into master 2025-10-24 17:22:40 +08:00
69 changed files with 2775 additions and 642 deletions
Showing only changes of commit 4e88fd9bfb - Show all commits

View File

@ -1,53 +0,0 @@
export interface StrapiEntity {
id: number;
documentId: string;
createdAt: string;
updatedAt: string;
publishedAt: string;
locale: string;
}
export interface StrapiMedia {
id: number;
url: string;
ext: string;
name: string;
size: number;
alternativeText: string;
caption: string;
}
export interface StrapiImageFormat {
url: string;
width: number;
height: number;
size: number;
}
export interface StrapiImage extends StrapiMedia {
width: number;
height: number;
formats: {
small: StrapiImageFormat;
medium: StrapiImageFormat;
thumbnail: StrapiImageFormat;
};
}
export interface StrapiResponse<T> {
data: T;
meta: {
pagination: {
page: number;
pageSize: number;
pageCount: number;
total: number;
};
};
}
export type StrapiRelation<T, K extends keyof T = never> = Omit<
T,
K | keyof StrapiEntity
> &
StrapiEntity;

View File

@ -1,5 +0,0 @@
export * from './common';
export * from './production';
export * from './singleTypes';
export * from './solution';
export * from './question';

View File

@ -1,41 +0,0 @@
import type {
StrapiEntity,
StrapiImage,
StrapiMedia,
StrapiRelation,
} from './common';
export interface ProductionType extends StrapiEntity {
type: string;
}
export interface ProductionSpecItem {
label: string;
value: string;
}
export interface ProductionSpecGroup {
title: string;
items: ProductionSpecItem[];
}
export interface Production extends StrapiEntity {
title: string;
summary: string;
production_type: ProductionType;
cover: StrapiImage;
production_images: StrapiImage[];
production_details: string;
production_specs: ProductionSpecGroup[];
production_documents: StrapiRelation<
ProductionDocument,
'related_productions'
>[];
questions: StrapiRelation<Question, 'related_productions'>[];
show_in_production_list: boolean;
}
export interface ProductionDocument extends StrapiEntity {
document: StrapiMedia;
related_productions: StrapiRelation<Production, 'production_documents'>[];
}

View File

@ -1,5 +0,0 @@
export interface Question extends StrapiEntity {
title: string;
content: string;
related_productions: StrapiRelation<Production, 'questions'>[];
}

View File

@ -1,13 +0,0 @@
export interface StrapiCompanyProfile extends StrapiEntity {
content: string;
}
export interface StrapiContactInfo extends StrapiEntity {
content: string;
}
export interface StrapiHomepage extends StrapiEntity {
carousel: StrapiImage[];
recommend_productions: StrapiRelation<Production>[];
recommend_solutions: StrapiRelation<Solution>[];
}

View File

@ -1,13 +0,0 @@
import type { StrapiEntity, StrapiImage } from './common';
export interface SolutionType extends StrapiEntity {
type: string;
}
export interface Solution extends StrapiEntity {
title: string;
summary: string;
cover: StrapiImage;
solution_type: SolutionType;
content: string;
}