msg.js 1.2 KB

1234567891011121314151617181920212223242526272829
  1. /**
  2. * 求职信
  3. */
  4. 'use strict';
  5. const Schema = require('mongoose').Schema;
  6. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  7. // 求职信信息
  8. const SchemaDefine = {
  9. post_id: { type: String, require: true }, // 职位ID
  10. resume_id: { type: String, require: true }, // 简历ID(学生ID)
  11. studname: { type: String, required: true, maxLength: 64 }, // 学生姓名
  12. corpname: { type: String, required: true, maxLength: 128 }, // 企业名称
  13. title: { type: String, required: true, maxLength: 128 }, // 职位标题
  14. status: { type: String, default: '0' }, // 状态: 0-新投递,未接收;1-已接收;2-已回绝
  15. type: { type: String, default: '0' }, // 求职信类型:0-在线招聘;1-招聘会;2-宣讲会;
  16. origin: { type: String, require: false }, // 信息来源ID:招聘信息ID、招聘会ID
  17. remark: { type: String, required: false, maxLength: 256 },
  18. };
  19. const schema = new Schema(SchemaDefine, { toJSON: { virtuals: true } });
  20. schema.index({ post_id: 1 });
  21. schema.index({ resume_id: 1 });
  22. schema.index({ post_id: 1, resume_id: 1 }, { unique: true });
  23. schema.plugin(metaPlugin);
  24. module.exports = app => {
  25. const { mongoose } = app;
  26. return mongoose.model('JobsMsg', schema, 'jobs_msg');
  27. };