user.js 791 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * 用户数据结构
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/6/28
  6. * @version
  7. */
  8. let mongoose = require("mongoose");
  9. let Schema = mongoose.Schema;
  10. // 表名
  11. let collectionName = 'user';
  12. // 表结构
  13. let schema = {
  14. username: String,
  15. email: String,
  16. mobile: String,
  17. real_name: {
  18. type: String,
  19. default: ''
  20. },
  21. company: {
  22. type: String,
  23. default: ''
  24. },
  25. province: {
  26. type: Number,
  27. default: -1
  28. },
  29. area: {
  30. type: Number,
  31. default: 0
  32. },
  33. company_type: {
  34. type: Number,
  35. default: -1,
  36. },
  37. company_scale: {
  38. type: Number,
  39. default: -1
  40. },
  41. create_time: Number
  42. };
  43. export default mongoose.model(collectionName, new Schema(schema, {versionKey: false}));