import { Rule, RuleType } from '@midwayjs/validate';
import { ApiProperty } from '@midwayjs/swagger';
import { dealVO } from '../../frame/VOBase';

export class FVO_dept {
  constructor(data: object) {
    dealVO(this, data);
  }
  @ApiProperty({ description: '数据id' })
  id: number = undefined;
  @ApiProperty({ description: '部门名称' })
  'name': string = undefined;
  @ApiProperty({ description: '资源权限' })
  'resource': Array<any> = undefined;
  @ApiProperty({ description: '上级部门id' })
  'parent_id': number = undefined;
  @ApiProperty({ description: '使用状态' })
  'is_use': string = undefined;
  @ApiProperty({ description: '是否是总部门' })
  'is_super': string = undefined;
  @ApiProperty({ description: '排序' })
  'order_num': number = undefined;
}

export class QDTO_dept {}

export class QVO_dept extends FVO_dept {
  constructor(data: object) {
    super(data);
    dealVO(this, data);
  }
}

export class CDTO_dept {
  @ApiProperty({ description: '部门名称' })
  @Rule(RuleType['string']().empty(''))
  'name': string = undefined;
  @ApiProperty({ description: '资源权限' })
  @Rule(RuleType['array']().empty(''))
  'resource': Array<any> = undefined;
  @ApiProperty({ description: '上级部门id' })
  @Rule(RuleType['number']().empty(''))
  'parent_id': number = undefined;
  @ApiProperty({ description: '使用状态' })
  @Rule(RuleType['string']().empty(''))
  'is_use': string = undefined;
  @ApiProperty({ description: '是否是总部门' })
  @Rule(RuleType['string']().empty(''))
  'is_super': string = undefined;
  @ApiProperty({ description: '排序' })
  @Rule(RuleType['number']().empty(''))
  'order_num': number = undefined;
}

export class CVO_dept extends FVO_dept {
  constructor(data: object) {
    super(data);
    dealVO(this, data);
  }
}

export class UDTO_dept extends CDTO_dept {
  @ApiProperty({ description: '数据id' })
  @Rule(RuleType['number']().empty(''))
  id: number = undefined;
}

export class UVAO_dept extends FVO_dept {
  constructor(data: object) {
    super(data);
    dealVO(this, data);
  }
}
