v4.6.2-alpah (#511)

This commit is contained in:
Archer
2023-11-24 15:29:43 +08:00
committed by GitHub
parent 60f752629f
commit 9cb4280a16
208 changed files with 5396 additions and 3500 deletions

View File

@@ -0,0 +1,31 @@
import { connectionMongo, type Model } from '../../../common/mongo';
const { Schema, model, models } = connectionMongo;
import type { PluginItemSchema } from '@fastgpt/global/core/plugin/type.d';
import { PluginCollectionName } from '../schema';
export const ModuleCollectionName = 'plugins';
const PluginStoreSchema = new Schema({
pluginId: {
type: Schema.Types.ObjectId,
ref: PluginCollectionName,
required: true
},
price: {
type: Number,
default: 0
},
updateTime: {
type: Date,
default: () => new Date()
},
modules: {
type: Array,
default: []
}
});
export const MongoPluginStore: Model<PluginItemSchema> =
models[ModuleCollectionName] || model(ModuleCollectionName, PluginStoreSchema);
MongoPluginStore.syncIndexes();