{"size": 669, "ext": "js", "max_stars_repo_path": "server/models/group.js", "max_stars_repo_name": "liuhong1happy/react-hichat", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/models/group.js", "max_issues_repo_name": "liuhong1happy/react-hichat", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/models/group.js", "max_forks_repo_name": "liuhong1happy/react-hichat", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 16.725, "max_line_length": 81, "alphanum_fraction": 0.6816143498}
'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var crypto = require('crypto');

var GroupSchema = new Schema({
	group_name:String,
	group_type: {
		type : String ,
		default : 'group'
	},
	group_no:{ 
		type:String,
		default: this.genGroupNo 
	},
	group_description:String,
	group_remove: Boolean,

	group_users:Array,
	upadte_dt:{
		type:Date,
		default: Date.now
	},
	create_dt:{
		type:Date,
		default: Date.now
	}
})

GroupSchema.methods = {
	genGroupNo: function(){
		return Math.ceil(Math.random()*100) + Date.now() + Math.ceil(Math.random()*100)
	}
}


var Group = mongoose.model('Group', GroupSchema);

module.exports = Group;