|
@@ -6,6 +6,7 @@ import { omit, pick } from 'lodash';
|
|
import { ErrorCode, ServiceError } from '../../error/service.error';
|
|
import { ErrorCode, ServiceError } from '../../error/service.error';
|
|
import { UserService } from '../../service/system/user.service';
|
|
import { UserService } from '../../service/system/user.service';
|
|
import { CVO_user, FVO_user, QVO_user, UVAO_user } from '../../interface/system/user.interface';
|
|
import { CVO_user, FVO_user, QVO_user, UVAO_user } from '../../interface/system/user.interface';
|
|
|
|
+import { RoleService } from '../../service/system/role.service';
|
|
const namePrefix = '平台用户';
|
|
const namePrefix = '平台用户';
|
|
@ApiTags(['平台用户'])
|
|
@ApiTags(['平台用户'])
|
|
@Controller('/user', { tagName: namePrefix })
|
|
@Controller('/user', { tagName: namePrefix })
|
|
@@ -14,6 +15,9 @@ export class UserController implements BaseController {
|
|
@Inject()
|
|
@Inject()
|
|
service: UserService;
|
|
service: UserService;
|
|
|
|
|
|
|
|
+ @Inject()
|
|
|
|
+ roleService: RoleService;
|
|
|
|
+
|
|
@Get('/')
|
|
@Get('/')
|
|
@ApiTags('列表查询')
|
|
@ApiTags('列表查询')
|
|
@ApiQuery({ name: 'query' })
|
|
@ApiQuery({ name: 'query' })
|
|
@@ -25,6 +29,17 @@ export class UserController implements BaseController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Get('/list')
|
|
|
|
+ async list(@Query() query: object) {
|
|
|
|
+ const qobj = omit(query, ['skip', 'limit']);
|
|
|
|
+ const others = pick(query, ['skip', 'limit']);
|
|
|
|
+ const { data, total } = await this.service.query(qobj, others);
|
|
|
|
+ for (let i of data) {
|
|
|
|
+ i = await this.roleService.Isaudit(i);
|
|
|
|
+ }
|
|
|
|
+ return { data, total };
|
|
|
|
+ }
|
|
|
|
+
|
|
@Get('/:id')
|
|
@Get('/:id')
|
|
@ApiTags('单查询')
|
|
@ApiTags('单查询')
|
|
@ApiResponse({ type: FVO_user })
|
|
@ApiResponse({ type: FVO_user })
|