|
@@ -0,0 +1,103 @@
|
|
|
+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_OrderDetail {
|
|
|
+ constructor(data: object) {
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '总订单id' })
|
|
|
+ 'order_id': string = undefined;
|
|
|
+ @ApiProperty({ description: '用户' })
|
|
|
+ 'user': string = undefined;
|
|
|
+ @ApiProperty({ description: '商品id' })
|
|
|
+ 'good': string = undefined;
|
|
|
+ @ApiProperty({ description: '规格id' })
|
|
|
+ 'spec': string = undefined;
|
|
|
+ @ApiProperty({ description: '收货地址' })
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '下单时间' })
|
|
|
+ 'buy_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_OrderDetail extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = ['order_id', 'user', 'good', 'spec', 'buy_time', 'status'];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '总订单id' })
|
|
|
+ 'order_id': string = undefined;
|
|
|
+ @ApiProperty({ description: '用户' })
|
|
|
+ 'user': string = undefined;
|
|
|
+ @ApiProperty({ description: '商品id' })
|
|
|
+ 'good': string = undefined;
|
|
|
+ @ApiProperty({ description: '规格id' })
|
|
|
+ 'spec': string = undefined;
|
|
|
+ @ApiProperty({ description: '下单时间' })
|
|
|
+ 'buy_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QVO_OrderDetail extends FVO_OrderDetail {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class CDTO_OrderDetail {
|
|
|
+ @ApiProperty({ description: '总订单id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'order_id': string = undefined;
|
|
|
+ @ApiProperty({ description: '用户' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'user': string = undefined;
|
|
|
+ @ApiProperty({ description: '商品id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'good': string = undefined;
|
|
|
+ @ApiProperty({ description: '规格id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'spec': string = undefined;
|
|
|
+ @ApiProperty({ description: '收货地址' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '下单时间' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'buy_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class CVO_OrderDetail extends FVO_OrderDetail {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class UDTO_OrderDetail extends CDTO_OrderDetail {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class UVAO_OrderDetail extends FVO_OrderDetail {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|