123456789101112131415161718192021222324252627 |
- 'use strict';
- const Controller = require('egg').Controller;
- class CatalogueController extends Controller {
- async create() {
- const res = await this.ctx.service.catalogue.create(this.ctx.request.body);
- this.ctx.body = res;
- }
- async update() {
- const res = await this.ctx.service.catalogue.update(this.ctx.request.body);
- this.ctx.body = res;
- }
- async delete() {
- const res = await this.ctx.service.catalogue.delete(this.ctx.params);
- this.ctx.body = res;
- }
- async query() {
- const res = await this.ctx.service.catalogue.query(this.ctx.query);
- this.ctx.body = res;
- }
- async fetch() {
- const res = await this.ctx.service.catalogue.fetch(this.ctx.query);
- this.ctx.body = res;
- }
- }
- module.exports = CatalogueController;
|