|
@@ -0,0 +1,71 @@
|
|
|
|
+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: 'logo长图' })
|
|
|
|
+ 'longlogo_url': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '管理员二维码' })
|
|
|
|
+ 'admin_url': Array<any> = 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: 'logo长图' })
|
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
|
+ 'longlogo_url': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '管理员二维码' })
|
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
|
+ 'admin_url': Array<any> = 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);
|
|
|
|
+ }
|
|
|
|
+}
|