123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- 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: '标题' })
- 'title': string = undefined;
- @ApiProperty({ description: '用户默认头像' })
- 'icon': Array<any> = undefined;
- @ApiProperty({ description: 'logo' })
- 'logo': Array<any> = undefined;
- @ApiProperty({ description: '联系电话' })
- 'phone': string = undefined;
- @ApiProperty({ description: '首页轮播图' })
- 'file': Array<any> = undefined;
- @ApiProperty({ description: '底部提示语' })
- 'bottom_title': string = undefined;
- @ApiProperty({ description: '通知' })
- 'notice': string = undefined;
- @ApiProperty({ description: '用户协议' })
- 'agreement': string = undefined;
- @ApiProperty({ description: '简介' })
- 'brief': 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: '标题' })
- @Rule(RuleType['string']().empty(''))
- 'title': string = undefined;
- @ApiProperty({ description: '用户默认头像' })
- @Rule(RuleType['array']().empty(''))
- 'icon': Array<any> = undefined;
- @ApiProperty({ description: 'logo' })
- @Rule(RuleType['array']().empty(''))
- 'logo': Array<any> = undefined;
- @ApiProperty({ description: '联系电话' })
- @Rule(RuleType['string']().empty(''))
- 'phone': string = undefined;
- @ApiProperty({ description: '首页轮播图' })
- @Rule(RuleType['array']().empty(''))
- 'file': Array<any> = undefined;
- @ApiProperty({ description: '底部提示语' })
- @Rule(RuleType['string']().empty(''))
- 'bottom_title': string = undefined;
- @ApiProperty({ description: '通知' })
- @Rule(RuleType['string']().empty(''))
- 'notice': string = undefined;
- @ApiProperty({ description: '用户协议' })
- @Rule(RuleType['string']().empty(''))
- 'agreement': string = undefined;
- @ApiProperty({ description: '简介' })
- @Rule(RuleType['string']().empty(''))
- 'brief': 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);
- }
- }
|