mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00

* mongo init * perf: mongo connect * perf: tts perf: whisper and tts peref: tts whisper permission log reabase (#488) * perf: modal * i18n * perf: schema lean * feat: vision model format * perf: tts loading * perf: static data * perf: tts * feat: image * perf: image * perf: upload image and title * perf: image size * doc * perf: color * doc * speaking can not select file * doc
35 lines
852 B
TypeScript
35 lines
852 B
TypeScript
import { connectionMongo, type Model } from '../../../common/mongo';
|
|
const { Schema, model, models } = connectionMongo;
|
|
import { PromotionRecordSchema as PromotionRecordType } from '@fastgpt/global/support/activity/type.d';
|
|
|
|
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: ['pay', 'register']
|
|
},
|
|
amount: {
|
|
// 1 * PRICE_SCALE
|
|
type: Number,
|
|
required: true
|
|
}
|
|
});
|
|
|
|
export const MongoPromotionRecord: Model<PromotionRecordType> =
|
|
models['promotionRecord'] || model('promotionRecord', PromotionRecordSchema);
|
|
MongoPromotionRecord.syncIndexes();
|