12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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_group {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: '管理医生' })
- 'doctor': string = undefined;
- @ApiProperty({ description: '群组病人' })
- 'patients': Array<any> = undefined;
- @ApiProperty({ description: '群组名称' })
- 'name': string = undefined;
- @ApiProperty({ description: '群简介' })
- 'content': string = undefined;
- }
- export class QDTO_group extends SearchBase {
- constructor() {
- const like_prop = ['name'];
- const props = ['doctor', 'patients'];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: '群组名称' })
- 'name': string = undefined;
- @ApiProperty({ description: '管理医生' })
- 'doctor': string = undefined;
- @ApiProperty({ description: '群组病人' })
- 'patients': Array<any> = undefined;
- }
- export class QVO_group extends FVO_group {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_group {
- @ApiProperty({ description: '管理医生' })
- @Rule(RuleType['string']().empty(''))
- 'doctor': string = undefined;
- @ApiProperty({ description: '群组病人' })
- @Rule(RuleType['array']().empty(''))
- 'patients': Array<any> = undefined;
- @ApiProperty({ description: '群组名称' })
- @Rule(RuleType['string']().empty(''))
- 'name': string = undefined;
- @ApiProperty({ description: '群简介' })
- @Rule(RuleType['string']().empty(''))
- 'content': string = undefined;
- }
- export class CVO_group extends FVO_group {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_group extends CDTO_group {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_group extends FVO_group {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|