-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #913 from pxgo/master
调整、添加、修复
- Loading branch information
Showing
411 changed files
with
17,724 additions
and
12,658 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const mongoose = require('../settings/database'); | ||
const collectionName = 'activationCodes'; | ||
const schema = new mongoose.Schema( | ||
{ | ||
_id: String, | ||
toc: { | ||
type: Date, | ||
default: Date.now, | ||
index: 1, | ||
}, | ||
used: { | ||
type: Boolean, | ||
default: false, | ||
index: 1, | ||
}, | ||
// 激活码的来源,考试系统, 管理员等 | ||
source: { | ||
type: String, | ||
required: true, | ||
}, | ||
// 来源ID | ||
sid: { | ||
type: String, | ||
required: true, | ||
}, | ||
uid: { | ||
type: String, | ||
default: '', | ||
}, | ||
timeOfUse: { | ||
type: Date, | ||
default: null, | ||
}, | ||
expiration: { | ||
type: Date, | ||
required: true, | ||
}, | ||
}, | ||
{ | ||
collection: collectionName, | ||
}, | ||
); | ||
|
||
module.exports = mongoose.model(collectionName, schema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.