123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- 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_address {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: '用户' })
- 'user': string = undefined;
- @ApiProperty({ description: '收货人' })
- 'name': string = undefined;
- @ApiProperty({ description: '收货人联系电话' })
- 'phone': string = undefined;
- @ApiProperty({ description: '省份' })
- 'province': string = undefined;
- @ApiProperty({ description: '城市' })
- 'city': string = undefined;
- @ApiProperty({ description: '区' })
- 'area': string = undefined;
- @ApiProperty({ description: '详细地址' })
- 'address': string = undefined;
- @ApiProperty({ description: '是否默认' })
- 'is_default': string = undefined;
- }
- export class QDTO_address extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = [];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- }
- export class QVO_address extends FVO_address {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_address {
- @ApiProperty({ description: '用户' })
- @Rule(RuleType['string']().empty(''))
- 'user': string = undefined;
- @ApiProperty({ description: '收货人' })
- @Rule(RuleType['string']().empty(''))
- 'name': string = undefined;
- @ApiProperty({ description: '收货人联系电话' })
- @Rule(RuleType['string']().empty(''))
- 'phone': string = undefined;
- @ApiProperty({ description: '省份' })
- @Rule(RuleType['string']().empty(''))
- 'province': string = undefined;
- @ApiProperty({ description: '城市' })
- @Rule(RuleType['string']().empty(''))
- 'city': string = undefined;
- @ApiProperty({ description: '区' })
- @Rule(RuleType['string']().empty(''))
- 'area': string = undefined;
- @ApiProperty({ description: '详细地址' })
- @Rule(RuleType['string']().empty(''))
- 'address': string = undefined;
- @ApiProperty({ description: '是否默认' })
- @Rule(RuleType['string']().empty(''))
- 'is_default': string = undefined;
- }
- export class CVO_address extends FVO_address {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_address extends CDTO_address {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_address extends FVO_address {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|