12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- import { Rule, RuleType } from '@midwayjs/validate';
- import { ApiProperty } from '@midwayjs/swagger';
- import { SearchBase } from 'free-midway-component';
- import get = require('lodash/get');
- const dealVO = (cla, data) => {
- for (const key in cla) {
- const val = get(data, key);
- if (val || val === 0) cla[key] = val;
- }
- };
- export class FVO_dictData {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: '字典类型编码' })
- 'code': string = undefined;
- @ApiProperty({ description: '数据显示值' })
- 'label': string = undefined;
- @ApiProperty({ description: '数据选择值' })
- 'value': string = undefined;
- @ApiProperty({ description: '排序' })
- 'sort': number = undefined;
- @ApiProperty({ description: '是否使用' })
- 'is_use': string = undefined;
- }
- export class QDTO_dictData extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = ['code', 'is_use'];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: '字典类型编码' })
- 'code': string = undefined;
- @ApiProperty({ description: '是否使用' })
- 'is_use': string = undefined;
- }
- export class QVO_dictData extends FVO_dictData {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_dictData {
- @ApiProperty({ description: '字典类型编码' })
- @Rule(RuleType['string']().empty(''))
- 'code': string = undefined;
- @ApiProperty({ description: '数据显示值' })
- @Rule(RuleType['string']().empty(''))
- 'label': string = undefined;
- @ApiProperty({ description: '数据选择值' })
- @Rule(RuleType['string']().empty(''))
- 'value': string = undefined;
- @ApiProperty({ description: '排序' })
- @Rule(RuleType['number']().empty(''))
- 'sort': number = undefined;
- @ApiProperty({ description: '是否使用' })
- @Rule(RuleType['string']().empty(''))
- 'is_use': string = undefined;
- }
- export class CVO_dictData extends FVO_dictData {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_dictData extends CDTO_dictData {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_dictData extends FVO_dictData {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|