12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- 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: '用户' })
- 'user': string = undefined;
- @ApiProperty({ description: '邮寄地址' })
- 'address': string = undefined;
- @ApiProperty({ description: '商品' })
- 'goods': Array<any> = undefined;
- @ApiProperty({ description: '总金额' })
- 'total_money': number = undefined;
- @ApiProperty({ description: '下单时间' })
- 'buy_time': string = undefined;
- @ApiProperty({ description: '审核记录' })
- 'record': Array<any> = undefined;
- @ApiProperty({ description: '订单状态' })
- 'status': string = undefined;
- }
- export class QDTO_Order extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = ['user', 'buy_time', 'status'];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: '用户' })
- 'user': string = undefined;
- @ApiProperty({ description: '下单时间' })
- 'buy_time': string = undefined;
- @ApiProperty({ description: '订单状态' })
- 'status': string = undefined;
- }
- 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(''))
- 'user': string = undefined;
- @ApiProperty({ description: '邮寄地址' })
- @Rule(RuleType['string']().empty(''))
- 'address': string = undefined;
- @ApiProperty({ description: '商品' })
- @Rule(RuleType['array']().empty(''))
- 'goods': Array<any> = undefined;
- @ApiProperty({ description: '总金额' })
- @Rule(RuleType['number']().empty(''))
- 'total_money': number = undefined;
- @ApiProperty({ description: '下单时间' })
- @Rule(RuleType['string']().empty(''))
- 'buy_time': string = undefined;
- @ApiProperty({ description: '审核记录' })
- @Rule(RuleType['array']().empty(''))
- 'record': Array<any> = undefined;
- @ApiProperty({ description: '订单状态' })
- @Rule(RuleType['string']().empty(''))
- 'status': 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);
- }
- }
|