This commit is contained in:
archer
2023-07-04 15:39:57 +08:00
parent 9bdd5f522d
commit 6e1ef89d65
44 changed files with 213 additions and 1216 deletions

View File

@@ -1,5 +1,5 @@
import { Schema, model, models, Model as MongoModel } from 'mongoose';
import { AppSchema as ModelType } from '@/types/mongoSchema';
import { Schema, model, models, Model } from 'mongoose';
import { AppSchema as AppType } from '@/types/mongoSchema';
import { ChatModelMap, OpenAiChatEnum } from '@/constants/model';
const AppSchema = new Schema({
@@ -105,4 +105,4 @@ try {
console.log(error);
}
export const Model: MongoModel<ModelType> = models['model'] || model('model', AppSchema);
export const App: Model<AppType> = models['model'] || model('model', AppSchema);

View File

@@ -0,0 +1,18 @@
import { Schema, model, models, Model } from 'mongoose';
import { ChatSchema as ChatType } from '@/types/mongoSchema';
import { ChatRoleMap } from '@/constants/chat';
const InstallAppSchema = new Schema({
userId: {
type: Schema.Types.ObjectId,
ref: 'user',
required: true
},
modelId: {
type: Schema.Types.ObjectId,
ref: 'model',
required: true
}
});
export const InstallApp: Model<ChatType> = models['installApp'] || model('chat', InstallAppSchema);