mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-24 04:40:18 +01:00
feat(check): add module of check in
This commit is contained in:
9
modules/checkin/client/checkin.client.module.js
Normal file
9
modules/checkin/client/checkin.client.module.js
Normal file
@@ -0,0 +1,9 @@
|
||||
(function (app) {
|
||||
'use strict';
|
||||
|
||||
app.registerModule('checkin', ['core']);// The core module is required for special route handling; see /core/client/config/core.client.routes
|
||||
app.registerModule('checkin.admin', ['core.admin']);
|
||||
app.registerModule('checkin.admin.routes', ['core.admin.routes']);
|
||||
app.registerModule('checkin.services');
|
||||
app.registerModule('checkin.routes', ['ui.router', 'core.routes', 'checkin.services']);
|
||||
}(ApplicationConfiguration));
|
||||
14
modules/checkin/server/config/checkin.server.config.js
Normal file
14
modules/checkin/server/config/checkin.server.config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
var path = require('path'),
|
||||
config = require(path.resolve('./config/config'));
|
||||
|
||||
/**
|
||||
* Module init function.
|
||||
*/
|
||||
module.exports = function (app, db) {
|
||||
|
||||
};
|
||||
30
modules/checkin/server/models/check.server.model.js
Normal file
30
modules/checkin/server/models/check.server.model.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
var mongoose = require('mongoose'),
|
||||
Schema = mongoose.Schema;
|
||||
|
||||
/**
|
||||
* Check in Schema
|
||||
*/
|
||||
var CheckSchema = new Schema({
|
||||
user: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'User'
|
||||
},
|
||||
keepDays: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
lastCheckedAt: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
}
|
||||
}, {usePushEach: true});
|
||||
|
||||
|
||||
CheckSchema.index({user: 1, createdAt: -1});
|
||||
|
||||
mongoose.model('Check', CheckSchema);
|
||||
Reference in New Issue
Block a user