dictModel.js 408 B

12345678910111213
  1. 'use strict';
  2. module.exports = app => {
  3. const mongoose = app.mongoose;
  4. const Schema = mongoose.Schema;
  5. const conn = app.mongooseDB.get('etlLocalDB');
  6. // 字典表 用于字典项
  7. const DictSchema = new Schema({
  8. code: { type: String }, // 字典code
  9. name: { type: String }, // 字典name
  10. p_code: { type: String }, // 父code
  11. });
  12. return conn.model('Dict', DictSchema, 'lc_dict');
  13. };