1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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_order {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: '微信用户' })
- 'openid': string = undefined;
- @ApiProperty({ description: '日期' })
- 'date': string = undefined;
- @ApiProperty({ description: '早餐' })
- 'breakfast': object = undefined;
- @ApiProperty({ description: '午餐' })
- 'lunch': object = undefined;
- @ApiProperty({ description: '晚餐' })
- 'dinner': object = undefined;
- @ApiProperty({ description: '备注' })
- 'remark': string = undefined;
- }
- export class QDTO_order extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = [];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- }
- export class QVO_order extends FVO_order {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_order {
- @ApiProperty({ description: '微信用户' })
- @Rule(RuleType['string']().empty(''))
- 'openid': string = undefined;
- @ApiProperty({ description: '日期' })
- @Rule(RuleType['string']().empty(''))
- 'date': string = undefined;
- @ApiProperty({ description: '早餐' })
- @Rule(RuleType['object']().empty(''))
- 'breakfast': object = undefined;
- @ApiProperty({ description: '午餐' })
- @Rule(RuleType['object']().empty(''))
- 'lunch': object = undefined;
- @ApiProperty({ description: '晚餐' })
- @Rule(RuleType['object']().empty(''))
- 'dinner': object = undefined;
- @ApiProperty({ description: '备注' })
- @Rule(RuleType['string']().empty(''))
- 'remark': string = undefined;
- }
- export class CVO_order extends FVO_order {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_order extends CDTO_order {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_order extends FVO_order {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|