recruitment.js 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const { Secret } = require('naf-framework-mongoose/lib/model/schema');
  5. // 招聘信息表
  6. const RecruitmentSchema = {
  7. license: { type: String, required: true, maxLength: 200 }, // 信用代码
  8. name: { type: String, required: true, maxLength: 500 }, // 招聘信息名称
  9. column_id: { type: String, required: false, maxLength: 200 }, // 栏目id
  10. salary: { type: String, required: false, maxLength: 200 }, // 职位月薪
  11. job_nature: { type: String, required: false, maxLength: 200 }, // 工作性质,0-兼职,1-全职
  12. profession: { type: String, required: false, maxLength: 500 }, // 公司名称
  13. workplace: { type: String, required: false, maxLength: 200 }, // 工作地点
  14. workexp: { type: String, required: false }, // 工作经验
  15. education: { type: String, required: false, maxLength: 200 }, // 学历
  16. people_number: { type: String, required: false, maxLength: 200 }, // 招聘人数
  17. explains: { type: String, required: false }, // 职位说明
  18. state: { type: String, required: false, maxLength: 200 }, // 状态,0-草稿,1-发布,2-删除
  19. };
  20. const schema = new Schema(RecruitmentSchema, { toJSON: { virtuals: true } });
  21. schema.index({ id: 1 });
  22. schema.plugin(metaPlugin);
  23. module.exports = app => {
  24. const { mongoose } = app;
  25. return mongoose.model('Recruitment', schema, 'talent_recruitment');
  26. }
  27. ;