user.js 798 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. ssoId: Number,
  15. username: String,
  16. email: String,
  17. mobile: String,
  18. real_name: {
  19. type: String,
  20. default: ''
  21. },
  22. company: {
  23. type: String,
  24. default: ''
  25. },
  26. province: {
  27. type: Number,
  28. default: -1
  29. },
  30. version: {
  31. type: String,
  32. default: ''
  33. },
  34. company_type: {
  35. type: Number,
  36. default: -1,
  37. },
  38. company_scale: {
  39. type: Number,
  40. default: -1
  41. },
  42. create_time: Number
  43. };
  44. mongoose.model(collectionName, new Schema(schema, {versionKey: false}));