1234567891011121314151617181920212223242526272829 |
- 'use strict';
- const _ = require('lodash');
- const Controller = require('egg').Controller;
- // 房间管理
- class RoomController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.room;
- }
- // 查询列表
- async index() {
- const data = await this.service.query(this.ctx.query);
- this.ctx.ok({ data });
- }
- // DELETE /{id}
- // 删除房间信息
- async destroy() {
- const { id } = this.ctx.params;
- await this.service.delete({ id });
- this.ctx.ok({ msg: 'deleted' });
- }
- }
- module.exports = RoomController;
|