/**
 * 用户数据结构
 *
 * @author CaiAoLin
 * @date 2017/6/28
 * @version
 */
let mongoose = require("mongoose");
let Schema = mongoose.Schema;

// 表名
let collectionName = 'user';

// 表结构
let schema = {
    username: String,
    email: String,
    mobile: String,
    real_name: {
        type: String,
        default: ''
    },
    company: {
        type: String,
        default: ''
    },
    province: {
        type: Number,
        default: -1
    },
    version: {
        type: String,
        default: ''
    },
    company_type: {
        type: Number,
        default: -1,
    },
    company_scale: {
        type: Number,
        default: -1
    },
    create_time: Number
};

export default mongoose.model(collectionName, new Schema(schema, {versionKey: false}));
