'use strict'; const Service = require('egg').Service; class ShopService extends Service { async Shop(obj) { const { ctx } = this; // 存储数据 // 留神!!!!ctx.model.xxx中xxx指的是model的文件名首字母大写 const ShopList = new ctx.model.ShopModel({ name: obj.name, // 姓名 notice: obj.notice, // 护照号 logo: obj.logo || {}, }); // 数据保留到数据库 ShopList.save(); return '增加胜利'; } } module.exports = ShopService;