'use strict'; const Schema = require('mongoose').Schema; const SchemaDefine = { // 商品类型 type: { type: String, required: true }, // 商品名 name: { type: String, required: true }, // 商品绑定货物ID bindId: { type: String, required: true }, // 商品状态 0=在售,1=下架,2=售馨 status: { type: String, required: true }, // 价格 money: { type: Number, required: true }, // 积分 integral: { type: Number, required: true }, // 图片 thumbnail: { type: String, required: true }, }; const schema = new Schema(SchemaDefine); module.exports = app => { const { mongoose } = app; return mongoose.model('market', schema, 'market'); };