feat: add types and list change

This commit is contained in:
2024-09-18 05:19:20 +08:00
parent 0a9e5c1d4f
commit 99f6f58f52
8 changed files with 127 additions and 271 deletions

View File

@@ -7,6 +7,16 @@ export interface ContainerData {
showChild?: boolean;
shadowRoot?: boolean;
}
export type Container = {
id?: string;
title?: string;
description?: string;
type?: string;
code?: string;
source?: string;
sourceType?: string;
data?: ContainerData;
};
export class ContainerModel extends Model {
declare id: string;
declare title: string;
@@ -14,6 +24,7 @@ export class ContainerModel extends Model {
declare type: string;
declare code: string;
declare source: string;
declare sourceType: string;
declare data: ContainerData;
}
ContainerModel.init(
@@ -37,13 +48,17 @@ ContainerModel.init(
defaultValue: '',
},
code: {
type: DataTypes.STRING,
type: DataTypes.TEXT,
defaultValue: '',
},
source: {
type: DataTypes.STRING,
defaultValue: '',
},
sourceType: {
type: DataTypes.STRING,
defaultValue: '',
},
data: {
type: DataTypes.JSON,
defaultValue: {},