chore: src/modules/base/controller/admin/sys/user.ts
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { Body, Inject, Post, Provide } from '@midwayjs/core';
|
||||
import { CoolController, BaseController } from '@cool-midway/core';
|
||||
import { BaseSysUserEntity } from '../../../entity/sys/user';
|
||||
import { BaseSysUserService } from '../../../service/sys/user';
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Provide()
|
||||
@CoolController({
|
||||
api: ['add', 'delete', 'update', 'info', 'list', 'page'],
|
||||
entity: BaseSysUserEntity,
|
||||
service: BaseSysUserService,
|
||||
insertParam: ctx => {
|
||||
return {
|
||||
userId: ctx.admin.userId,
|
||||
};
|
||||
},
|
||||
})
|
||||
export class BaseSysUserController extends BaseController {
|
||||
@Inject()
|
||||
baseSysUserService: BaseSysUserService;
|
||||
|
||||
/**
|
||||
* 移动部门
|
||||
*/
|
||||
@Post('/move', { summary: '移动部门' })
|
||||
async move(
|
||||
@Body('departmentId') departmentId: number,
|
||||
@Body('userIds') userIds: []
|
||||
) {
|
||||
await this.baseSysUserService.move(departmentId, userIds);
|
||||
return this.ok();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user