perf: binary avatar

This commit is contained in:
archer
2023-06-14 22:26:11 +08:00
parent 7c159d8aba
commit 7c52cec0ea
16 changed files with 98 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
import { Schema, model, models, Model } from 'mongoose';
const ImageSchema = new Schema({
userId: {
type: Schema.Types.ObjectId,
ref: 'user',
required: true
},
binary: {
type: Buffer
}
});
export const Image: Model<{ userId: string; binary: Buffer }> =
models['image'] || model('image', ImageSchema);

View File

@@ -68,3 +68,4 @@ export * from './models/shareChat';
export * from './models/kb';
export * from './models/inform';
export * from './models/system';
export * from './models/image';