'use strict'; const Controller = require('egg').Controller; class SysUserController extends Controller { async list() { const {ctx, service} = this; let query = ctx.request.query; let ret = await service.sysUser.list(query); ctx.adminOK(ret); } async roleList() { const {ctx, service} = this; let query = ctx.request.query; let ret = await service.sysUser.roleList(query); ctx.adminOK(ret); } async userRoleList() { const {ctx, service} = this; let query = ctx.request.query; let ret = await service.sysUser.userRoleList(query); ctx.adminOK(ret); } async delete() { const {ctx, service} = this; let id = ctx.request.query.id; let ret = await service.sysUser.delete(id); ctx.adminOK(ret, "删除成功"); } async deleteRole() { const {ctx, service} = this; let id = ctx.request.query.id; let ret = await service.sysUser.deleteRole(id); ctx.adminOK(ret, "删除成功"); } async deleteUserRole() { const {ctx, service} = this; let data = ctx.request.query; let ret = await service.sysUser.deleteUserRole(data); ctx.adminOK(ret, "删除成功"); } async deleteUserRoleBatch () { const {ctx, service} = this; let data = ctx.request.query; let ret = await service.sysUser.deleteUserRoleBatch(data); ctx.adminOK(ret, "删除成功"); } async edit() { const {ctx, service} = this; let data = ctx.request.body; let ret = await service.sysUser.edit( data ); ctx.adminOK(ret, "更新成功"); } async editRole() { const {ctx, service} = this; let data = ctx.request.body; let ret = await service.sysUser.editRole( data ); ctx.adminOK(ret, "更新成功"); } async add() { const {ctx, service} = this; let data = ctx.request.body; let ret = await service.sysUser.add( data ); ctx.adminOK(ret, "添加成功"); } async addRole() { const {ctx, service} = this; let data = ctx.request.body; let ret = await service.sysUser.addRole( data ); ctx.adminOK(ret, "添加成功"); } async addSysUserRole() { const {ctx, service} = this; let data = ctx.request.body; let ret = await service.sysUser.addSysUserRole( data ); ctx.adminOK(ret, "添加成功"); } async resetpwd() { const {ctx, service} = this; let data = ctx.request.body; let ret = await service.sysUser.resetpwd( data ); ctx.adminOK(ret, "重置成功"); } async frozenBatch() { const {ctx, service} = this; let data = ctx.request.body; let ret = await service.sysUser.frozenBatch( data ); ctx.adminOK(ret, "冻结成功"); } async queryUserRole() { const {ctx, service} = this; let data = ctx.request.query; let ret = await service.sysUser.queryUserRole( data ); ctx.adminOK(ret); } async checkOnlyUser() { const {ctx, service} = this; let data = ctx.request.query; let ret = await service.sysUser.checkOnlyUser( data ); ctx.adminOK(ret); } async queryTreeList() { const {ctx, service} = this; await ctx.queryHandleByService(service.sysUser, "queryTreeList"); } async saveRolePermission() { //sys/permission/saveRolePermission const {ctx, service} = this; await ctx.bodyHandleByService(service.sysUser, "saveRolePermission", "保存成功"); } async queryRolePermission() { const {ctx, service} = this; await ctx.queryHandleByService(service.sysUser, "queryRolePermission"); } } module.exports = SysUserController;