123456789101112131415161718192021222324252627282930313233 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 问题咨询
- const problem_service = {
- name: { type: String, required: false }, // 问题名称
- ask_id: { type: String, required: false }, // 发问人id
- ask_name: { type: String, required: false }, // 发问人
- ask_date: { type: String, required: false }, // 发问时间
- ask_explain: { type: String, required: false }, // 问题说明
- ask_file: { type: Array, required: false }, // 问题文件
- answer_id: { type: String, required: false }, // 答题人id
- answer_name: { type: String, required: false }, // 答题人
- answer_date: { type: String, required: false }, // 答题时间
- answer_explain: { type: String, required: false }, // 答题说明
- answer_file: { type: Array, required: false }, // 答题文件
- status: { type: String, required: false }, // 状态:【0:待受理,1:已分配,2:已回答,3:已发送答案,4:已阅读】
- };
- const schema = new Schema(problem_service, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.index({ name: 1 });
- schema.index({ ask_id: 1 });
- schema.index({ ask_name: 1 });
- schema.index({ ask_date: 1 });
- schema.index({ answer_id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Problem_Service', schema, 'problem_service');
- };
|