1234567891011121314151617181920212223242526272829303132333435 |
- 'use strict';
- const _ = require('lodash');
- const meta = require('./.bedroom.js');
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // 寝室管理
- class BedroomController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.bedroom;
- }
- // 一键分寝
- async apart() {
- const res = await this.service.apart(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- async ibeacon() {
- console.log(this.ctx.request.body);
- const res = await this.service.ibeacon(this.ctx.request.body);
- this.ctx.ok({ ...res });
- }
- async roomstu() {
- const data = await this.service.roomstu(this.ctx.params);
- this.ctx.ok({ data });
- }
- }
- module.exports = CrudController(BedroomController, meta);
|