noticeModel.js 614 B

123456789101112131415161718192021222324252627
  1. 'use strict';
  2. module.exports = app => {
  3. const mongoose = app.mongoose;
  4. const Schema = mongoose.Schema;
  5. const NoticeSchema = new Schema({
  6. dept1: { type: String },
  7. dept2: { type: String },
  8. dept3: { type: String },
  9. userid: {
  10. type: Schema.Types.ObjectId,
  11. ref: 'sysUser',
  12. },
  13. deptId: {
  14. type: Schema.Types.ObjectId,
  15. ref: 'sysDept',
  16. },
  17. level: { type: String },
  18. title: { type: String },
  19. content: { type: String },
  20. createTime: { type: Date, default: Date.now }, // 创建时间
  21. });
  22. return mongoose.model('Notice', NoticeSchema, 'notice');
  23. };