mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
Some checks failed
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run
Deploy image by kubeconfig / build-fastgpt-docs-images (push) Has been cancelled
Deploy image to vercel / deploy-production (push) Has been cancelled
Sync images / sync (push) Has been cancelled
Deploy image by kubeconfig / update-docs-image (push) Has been cancelled
* feat: question guide * fix * fix * fix * change interface * fix
41 lines
914 B
TypeScript
41 lines
914 B
TypeScript
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
|
|
import { connectionMongo, type Model } from '../../common/mongo';
|
|
const { Schema, model, models } = connectionMongo;
|
|
|
|
export const AppQGuideCollectionName = 'app_question_guides';
|
|
|
|
type AppQGuideSchemaType = {
|
|
_id: string;
|
|
appId: string;
|
|
teamId: string;
|
|
text: string;
|
|
};
|
|
|
|
const AppQGuideSchema = new Schema({
|
|
appId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: AppQGuideCollectionName,
|
|
required: true
|
|
},
|
|
teamId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: TeamCollectionName,
|
|
required: true
|
|
},
|
|
text: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
});
|
|
|
|
try {
|
|
AppQGuideSchema.index({ appId: 1 });
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
|
|
export const MongoAppQGuide: Model<AppQGuideSchemaType> =
|
|
models[AppQGuideCollectionName] || model(AppQGuideCollectionName, AppQGuideSchema);
|
|
|
|
MongoAppQGuide.syncIndexes();
|