feat: 好友邀请

This commit is contained in:
archer
2023-04-21 22:23:19 +08:00
parent 4f51839026
commit 4397a0ad6b
22 changed files with 471 additions and 17 deletions

View File

@@ -0,0 +1,31 @@
import { Schema, model, models, Model } from 'mongoose';
import { PromotionRecordSchema as PromotionRecordType } from '@/types/mongoSchema';
const PromotionRecordSchema = new Schema({
userId: {
type: Schema.Types.ObjectId,
ref: 'user',
required: true
},
objUId: {
type: Schema.Types.ObjectId,
ref: 'user',
required: false
},
createTime: {
type: Date,
default: () => new Date()
},
type: {
type: String,
required: true,
enum: ['invite', 'shareModel', 'withdraw']
},
amount: {
type: Number,
required: true
}
});
export const promotionRecord: Model<PromotionRecordType> =
models['promotionRecord'] || model('promotionRecord', PromotionRecordSchema);

View File

@@ -31,11 +31,6 @@ const UserSchema = new Schema({
// 返现比例
type: Number,
default: 15
},
amount: {
// 推广金额
type: Number,
default: 0
}
},
openaiKey: {