feat: 新增app管理和文件管理
This commit is contained in:
57
src/routes/app-manager/module/app-list.ts
Normal file
57
src/routes/app-manager/module/app-list.ts
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user