123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- 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_association {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: '平台用户id' })
- 'user': string = undefined;
- @ApiProperty({ description: '名称' })
- 'name': string = undefined;
- @ApiProperty({ description: '负责人' })
- 'person': string = undefined;
- @ApiProperty({ description: '负责人电话' })
- 'person_phone': string = undefined;
- @ApiProperty({ description: '简介' })
- 'brief': string = undefined;
- @ApiProperty({ description: '地址' })
- 'address': string = undefined;
- @ApiProperty({ description: '是否公开' })
- 'is_show': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QDTO_association extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = ['user', 'name', 'person_phone', 'is_show', 'status'];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: '平台用户id' })
- 'user': string = undefined;
- @ApiProperty({ description: '名称' })
- 'name': string = undefined;
- @ApiProperty({ description: '负责人电话' })
- 'person_phone': string = undefined;
- @ApiProperty({ description: '是否公开' })
- 'is_show': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QVO_association extends FVO_association {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_association {
- @ApiProperty({ description: '平台用户id' })
- @Rule(RuleType['string']().empty(''))
- 'user': string = undefined;
- @ApiProperty({ description: '名称' })
- @Rule(RuleType['string']().empty(''))
- 'name': string = undefined;
- @ApiProperty({ description: '负责人' })
- @Rule(RuleType['string']().empty(''))
- 'person': string = undefined;
- @ApiProperty({ description: '负责人电话' })
- @Rule(RuleType['string']().empty(''))
- 'person_phone': string = undefined;
- @ApiProperty({ description: '简介' })
- @Rule(RuleType['string']().empty(''))
- 'brief': string = undefined;
- @ApiProperty({ description: '地址' })
- @Rule(RuleType['string']().empty(''))
- 'address': string = undefined;
- @ApiProperty({ description: '是否公开' })
- @Rule(RuleType['string']().empty(''))
- 'is_show': string = undefined;
- @ApiProperty({ description: '状态' })
- @Rule(RuleType['string']().empty(''))
- 'status': string = undefined;
- }
- export class CVO_association extends FVO_association {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_association extends CDTO_association {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_association extends FVO_association {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|