userBindRole.js 951 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class UserBindRoleController extends Controller {
  4. async bind() {
  5. const res = await this.ctx.service.userBindRole.bind(this.ctx.request.body);
  6. this.ctx.body = res;
  7. }
  8. async unbind() {
  9. const res = await this.ctx.service.userBindRole.unbind(this.ctx.request.body);
  10. this.ctx.body = res;
  11. }
  12. async queryBind() {
  13. const res = await this.ctx.service.userBindRole.queryBind(this.ctx.query);
  14. this.ctx.body = res;
  15. }
  16. async queryRole() {
  17. const res = await this.ctx.service.userBindRole.queryRole(this.ctx.query);
  18. this.ctx.body = res;
  19. }
  20. async batchBind() {
  21. const res = await this.ctx.service.userBindRole.batchBind(this.ctx.request.body);
  22. this.ctx.body = res;
  23. }
  24. async batchUnBind() {
  25. const res = await this.ctx.service.userBindRole.batchUnBind(this.ctx.request.body);
  26. this.ctx.body = res;
  27. }
  28. }
  29. module.exports = UserBindRoleController;