nihao 1f1ee2a070 新增栏目与菜单 5 年之前
..
README.md c29e37b9a5 Update README.md 7 年之前
column.js 1f1ee2a070 新增栏目与菜单 5 年之前
menu.js 1f1ee2a070 新增栏目与菜单 5 年之前
news.js f42a8a8cf3 news模块实现 6 年之前
site.js c6ab8084ee 完成服务和测试 6 年之前

README.md

数据模型

'use strict';
const Schema = require('mongoose').Schema;

const SchemaDefine = {
  code: { type: String, required: true, maxLength: 64 },
  name: { type: String, required: true, maxLength: 128 },
  order: Number,
};
const schema = new Schema(SchemaDefine);
schema.index({ code: 1 }, { unique: true });

module.exports = app => {
  const { mongoose } = app;
  return mongoose.model('CodeCategory', schema, 'naf_code_category');
};