// 单个error详情信息 async getErrorDetail() { const { ctx } = this; const query = ctx.request.query; const id = query.id; const appId = query.appId; if (!id) throw new Error('单个error详情信息:id不能为空'); if (!appId) throw new Error('单个error详情信息:appId不能为空'); const result = await ctx.service.wx.errors.getErrorDetail(appId, id); ctx.body = this.app.result({ data: result, }); }
// 单个页面详情 async getPageDetails() { const { ctx } = this; const query = ctx.request.query; const appId = query.appId; const id = query.id; if (!appId) throw new Error('单个页面详情:appId不能为空'); if (!id) throw new Error('单个页面详情:id不能为空'); const result = await ctx.service.wx.pages.getPageDetails(appId, id, 1); ctx.body = this.app.result({ data: result, }); }
// 获得单个ajax详情信息 async getOneAjaxDetail() { const { ctx } = this; const query = ctx.request.query; const id = query.id; const appId = query.appId; if (!id) throw new Error('获得单个ajax详情信息:id不能为空'); if (!appId) throw new Error('获得单个ajax详情信息:appId不能为空'); const result = await ctx.service.web.ajaxs.getOneAjaxDetail(appId, id); ctx.body = this.app.result({ data: result, }); }
async getShoppingById() { const { ctx, service } = this; const spid = ctx.request.query.id; const result = await service.shopping.getShoppingById(spid); ctx.body = result; ctx.status = 200; }
async index() { const { ctx, app } = this const month = parseInt(ctx.params.month) || 1 const user_id = ctx.request.query.id
// 获得单个Resource详情信息 async getOneResourceDetail() { const { ctx } = this; const query = ctx.request.query; const id = query.id; const appId = query.appId; if (!id) throw new Error('获得单个Resource详情信息:id不能为空'); if (!appId) throw new Error('获得单个Resource详情信息:appId不能为空'); const result = await ctx.service.web.resource.getOneResourceDetail(appId, id); ctx.body = this.app.result({ data: result, }); }
async find() { const { ctx, service } = this; // get请求获取的参数ctx.request.query const id = ctx.request.query.id; const result = await service.banner.findByID(id); ctx.body = result; ctx.status = 200; }
// 单个页面详情 async getPageDetails() { const { ctx } = this; const query = ctx.request.query; const id = query.id; const appId = query.appId; if (!id) throw new Error('单个页面详情:id不能为空'); if (!appId) throw new Error('单个页面详情:appId不能为空'); const result = await ctx.service.web.pages.getPageDetails(appId, id); ctx.body = this.app.result({ data: result, }); }
async find() { const { ctx, service } = this; // get请求获取的参数ctx.request.query const id = ctx.request.query.id; const result = await service.shopping.findByID(id); ctx.body = result; ctx.status = 200; }
// 获得单个ajax详情信息 async getOneAjaxDetail() { const { ctx } = this; const query = ctx.request.query; const id = query.id; const appId = query.appId; if (!id) throw new Error('获得单个ajax详情信息:id不能为空'); if (!appId) throw new Error('获得单个ajax详情信息:appId不能为空'); const result = await ctx.service.wx.ajaxs.getOneAjaxDetail(appId, id); ctx.body = this.app.result({ data: result, }); }
// 单个error详情信息 async getErrorDetail() { const { ctx } = this; const query = ctx.request.query; const id = query.id; const appId = query.appId; if (!id) throw new Error('单个error详情信息:id不能为空'); if (!appId) throw new Error('单个error详情信息:appId不能为空'); const result = await ctx.service.web.errors.getErrorDetail(appId, id); ctx.body = this.app.result({ data: result, }); }