mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
Perf input guide (#1557)
* perf: input guide code * perf: input guide ui * Chat input guide api * Update app chat config store * perf: app chat config field * perf: app context * perf: params * fix: ts * perf: filter private config * perf: filter private config * perf: import workflow * perf: limit max tip amount
This commit is contained in:
41
packages/service/core/app/version/schema.ts
Normal file
41
packages/service/core/app/version/schema.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { connectionMongo, type Model } from '../../../common/mongo';
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
import { AppVersionSchemaType } from '@fastgpt/global/core/app/version';
|
||||
import { chatConfigType } from '../schema';
|
||||
|
||||
export const AppVersionCollectionName = 'app_versions';
|
||||
|
||||
const AppVersionSchema = new Schema({
|
||||
appId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: AppVersionCollectionName,
|
||||
required: true
|
||||
},
|
||||
time: {
|
||||
type: Date,
|
||||
default: () => new Date()
|
||||
},
|
||||
nodes: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
edges: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
chatConfig: {
|
||||
type: chatConfigType,
|
||||
default: {}
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
AppVersionSchema.index({ appId: 1, time: -1 });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
export const MongoAppVersion: Model<AppVersionSchemaType> =
|
||||
models[AppVersionCollectionName] || model(AppVersionCollectionName, AppVersionSchema);
|
||||
|
||||
MongoAppVersion.syncIndexes();
|
Reference in New Issue
Block a user