123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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_Config {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: 'logo' })
- 'logo_url': Array<any> = undefined;
- @ApiProperty({ description: '男头像' })
- 'boy_url': Array<any> = undefined;
- @ApiProperty({ description: '女头像' })
- 'girl_url': Array<any> = undefined;
- @ApiProperty({ description: '用户协议' })
- 'agree': string = undefined;
- @ApiProperty({ description: '底部文案' })
- 'bottom_title': string = undefined;
- }
- export class QDTO_Config extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = [];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- }
- export class QVO_Config extends FVO_Config {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_Config {
- @ApiProperty({ description: 'logo' })
- @Rule(RuleType['array']().empty(''))
- 'logo_url': Array<any> = undefined;
- @ApiProperty({ description: '男头像' })
- @Rule(RuleType['array']().empty(''))
- 'boy_url': Array<any> = undefined;
- @ApiProperty({ description: '女头像' })
- @Rule(RuleType['array']().empty(''))
- 'girl_url': Array<any> = undefined;
- @ApiProperty({ description: '用户协议' })
- @Rule(RuleType['string']().empty(''))
- 'agree': string = undefined;
- @ApiProperty({ description: '底部文案' })
- @Rule(RuleType['string']().empty(''))
- 'bottom_title': string = undefined;
- }
- export class CVO_Config extends FVO_Config {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_Config extends CDTO_Config {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_Config extends FVO_Config {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
|