feat: app detail

This commit is contained in:
archer
2023-07-13 15:07:13 +08:00
parent 6c72c20317
commit b4d46ff34d
47 changed files with 1088 additions and 1091 deletions

View File

@@ -105,4 +105,4 @@ try {
console.log(error);
}
export const App: Model<AppType> = models['model'] || model('model', AppSchema);
export const App: Model<AppType> = models['app'] || model('app', AppSchema);

View File

@@ -16,12 +16,11 @@ const BillSchema = new Schema({
},
modelName: {
type: String,
enum: [...Object.keys(ChatModelMap), embeddingModel],
required: true
enum: [...Object.keys(ChatModelMap), embeddingModel]
},
chatId: {
appId: {
type: Schema.Types.ObjectId,
ref: 'chat'
ref: 'app'
},
time: {
type: Date,
@@ -44,8 +43,9 @@ const BillSchema = new Schema({
});
try {
BillSchema.index({ time: -1 });
BillSchema.index({ userId: 1 });
// BillSchema.index({ time: -1 });
// BillSchema.index({ time: 1 }, { expireAfterSeconds: 90 * 24 * 60 });
} catch (error) {
console.log(error);
}

View File

@@ -10,7 +10,7 @@ const ChatSchema = new Schema({
},
appId: {
type: Schema.Types.ObjectId,
ref: 'model',
ref: 'app',
required: true
},
updateTime: {