12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 'use strict';
- const _ = require('lodash');
- const meta = require('./.lookuser.js');
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // 管理
- class LookuserController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.lookuser;
- }
- async update() {
- const res = await this.service.update(this.ctx.params, this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- async roomcount() {
- const data = await this.service.roomcount(this.ctx.query);
- this.ctx.ok({ ...data });
- }
- async swichrole() {
- const res = await this.service.userswichrole(this.ctx.query);
- this.ctx.ok({ data: res });
- }
- async updatexf() {
- const res = await this.service.updatexf(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- async index() {
- const data = await this.service.query(this.ctx.query);
- this.ctx.ok({ ...data });
- }
- }
- module.exports = CrudController(LookuserController, meta);
|