mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-05 14:47:38 +00:00
monorepo packages (#344)
This commit is contained in:
24
projects/app/src/service/common/ipLimit/schema.ts
Normal file
24
projects/app/src/service/common/ipLimit/schema.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Schema, model, models, Model } from 'mongoose';
|
||||
import type { IpLimitSchemaType } from '@/types/common/ipLimit';
|
||||
|
||||
const IpLimitSchema = new Schema({
|
||||
eventId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
ip: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
account: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
lastMinute: {
|
||||
type: Date,
|
||||
default: () => new Date()
|
||||
}
|
||||
});
|
||||
|
||||
export const IpLimit: Model<IpLimitSchemaType> =
|
||||
models['ip_limit'] || model('ip_limit', IpLimitSchema);
|
Reference in New Issue
Block a user