|
@@ -0,0 +1,86 @@
|
|
|
+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_design {
|
|
|
+ constructor(data: object) {
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ 'zhTitle': string = undefined;
|
|
|
+ @ApiProperty({ description: '英文标题' })
|
|
|
+ 'zhEnglish': string = undefined;
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
+ 'zhBrief': string = undefined;
|
|
|
+ @ApiProperty({ description: 'logo' })
|
|
|
+ 'logoUrl': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '视频' })
|
|
|
+ 'videoUrl': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '网站底部信息' })
|
|
|
+ 'footInfo': object = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_design extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = [];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class QVO_design extends FVO_design {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class CDTO_design {
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'zhTitle': string = undefined;
|
|
|
+ @ApiProperty({ description: '英文标题' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'zhEnglish': string = undefined;
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'zhBrief': string = undefined;
|
|
|
+ @ApiProperty({ description: 'logo' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'logoUrl': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '视频' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'videoUrl': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '网站底部信息' })
|
|
|
+ @Rule(RuleType['object']().empty(''))
|
|
|
+ 'footInfo': object = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class CVO_design extends FVO_design {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class UDTO_design extends CDTO_design {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class UVAO_design extends FVO_design {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|