2024-12-30 21:45:46 +08:00
|
|
|
const mongoose = require('mongoose');
|
2024-12-31 09:27:15 +08:00
|
|
|
const { getNowChinaTimeString } = require('../utils/date');
|
2024-12-30 21:45:46 +08:00
|
|
|
|
|
|
|
|
const licenseKeySchema = new mongoose.Schema({
|
|
|
|
|
licenseKey: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
unique: true
|
|
|
|
|
},
|
|
|
|
|
isUsed: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false
|
|
|
|
|
},
|
|
|
|
|
generatedAt: {
|
2024-12-31 09:27:15 +08:00
|
|
|
type: String,
|
|
|
|
|
default() {
|
|
|
|
|
return getNowChinaTimeString();
|
|
|
|
|
}
|
2024-12-30 21:45:46 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
module.exports = mongoose.model('LicenseKey', licenseKeySchema);
|