feat: 新增app管理和文件管理

This commit is contained in:
2024-10-06 20:10:20 +08:00
parent 1f81d3400c
commit 477ad00d86
18 changed files with 713 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
import { sequelize } from '../../../modules/sequelize.ts';
import { DataTypes, Model } from 'sequelize';
import { AppData, AppType } from './app.ts';
export type AppList = Partial<InstanceType<typeof AppListModel>>;
/**
* APP List 管理
*/
export class AppListModel extends Model {
declare id: string;
declare data: AppData;
declare version: string;
declare appType: AppType;
declare type: string;
declare uid: string;
}
AppListModel.init(
{
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4,
comment: 'id',
},
data: {
type: DataTypes.JSON,
defaultValue: {},
},
version: {
type: DataTypes.STRING,
defaultValue: '',
},
appType: {
type: DataTypes.STRING,
defaultValue: '',
},
type: {
type: DataTypes.STRING,
defaultValue: '',
},
uid: {
type: DataTypes.UUID,
allowNull: true,
},
},
{
sequelize,
tableName: 'kv_app_list',
paranoid: true,
},
);
AppListModel.sync({ alter: true, logging: false }).catch((e) => {
console.error('AppListModel sync', e);
});