|
@@ -1,6 +1,6 @@
|
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
|
import { ApiProperty } from '@midwayjs/swagger';
|
|
|
-import { SearchBase } from 'free-midway-component';
|
|
|
+import { FrameworkErrorEnum, SearchBase, ServiceError } from 'free-midway-component';
|
|
|
import get = require('lodash/get');
|
|
|
const dealVO = (cla, data) => {
|
|
|
for (const key in cla) {
|
|
@@ -14,33 +14,33 @@ export class FVO_admin {
|
|
|
}
|
|
|
@ApiProperty({ description: '数据id' })
|
|
|
_id: string = undefined;
|
|
|
+ @ApiProperty({ description: '管理员名称' })
|
|
|
+ 'nick_name': string = undefined;
|
|
|
@ApiProperty({ description: '账号' })
|
|
|
'account': string = undefined;
|
|
|
- @ApiProperty({ description: '名称' })
|
|
|
- 'nick_name': string = undefined;
|
|
|
@ApiProperty({ description: '密码' })
|
|
|
'password': string = undefined;
|
|
|
+ @ApiProperty({ description: '拥有角色' })
|
|
|
+ 'role': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '所属部门' })
|
|
|
+ 'dept': string = undefined;
|
|
|
@ApiProperty({ description: '是否是超级管理员' })
|
|
|
'is_super': string = undefined;
|
|
|
- @ApiProperty({ description: '角色' })
|
|
|
- 'role': string = undefined;
|
|
|
- @ApiProperty({ description: 'openid' })
|
|
|
- 'openid': string = undefined;
|
|
|
- @ApiProperty({ description: '是否启用' })
|
|
|
+ @ApiProperty({ description: '使用状态' })
|
|
|
'is_use': string = undefined;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
export class QDTO_admin extends SearchBase {
|
|
|
constructor() {
|
|
|
const like_prop = [];
|
|
|
- const props = ['account'];
|
|
|
+ const props = [];
|
|
|
const mapping = [];
|
|
|
super({ like_prop, props, mapping });
|
|
|
}
|
|
|
- @ApiProperty({ description: '账号' })
|
|
|
- 'account': string = undefined;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
export class QVO_admin extends FVO_admin {
|
|
|
constructor(data: object) {
|
|
|
super(data);
|
|
@@ -48,30 +48,32 @@ export class QVO_admin extends FVO_admin {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
export class CDTO_admin {
|
|
|
+ @ApiProperty({ description: '管理员名称' })
|
|
|
+@Rule(RuleType['string']().required().error(new ServiceError('缺少管理员名称',FrameworkErrorEnum.NEED_BODY)))
|
|
|
+ 'nick_name': string = undefined;
|
|
|
@ApiProperty({ description: '账号' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
+@Rule(RuleType['string']().required().error(new ServiceError('缺少账号',FrameworkErrorEnum.NEED_BODY)))
|
|
|
'account': string = undefined;
|
|
|
- @ApiProperty({ description: '名称' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
- 'nick_name': string = undefined;
|
|
|
@ApiProperty({ description: '密码' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
+@Rule(RuleType['string']().required().error(new ServiceError('缺少密码',FrameworkErrorEnum.NEED_BODY)))
|
|
|
'password': string = undefined;
|
|
|
+ @ApiProperty({ description: '拥有角色' })
|
|
|
+@Rule(RuleType['array']().empty(''))
|
|
|
+ 'role': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '所属部门' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'dept': string = undefined;
|
|
|
@ApiProperty({ description: '是否是超级管理员' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
'is_super': string = undefined;
|
|
|
- @ApiProperty({ description: '角色' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
- 'role': string = undefined;
|
|
|
- @ApiProperty({ description: 'openid' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
- 'openid': string = undefined;
|
|
|
- @ApiProperty({ description: '是否启用' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
+ @ApiProperty({ description: '使用状态' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
'is_use': string = undefined;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
export class CVO_admin extends FVO_admin {
|
|
|
constructor(data: object) {
|
|
|
super(data);
|
|
@@ -79,12 +81,14 @@ export class CVO_admin extends FVO_admin {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
export class UDTO_admin extends CDTO_admin {
|
|
|
- @ApiProperty({ description: '数据id' })
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
- _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
export class UVAO_admin extends FVO_admin {
|
|
|
constructor(data: object) {
|
|
|
super(data);
|