|
@@ -0,0 +1,100 @@
|
|
|
+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_tags {
|
|
|
+ constructor(data: object) {
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ 'title': string = undefined;
|
|
|
+ @ApiProperty({ description: '类型' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '路由' })
|
|
|
+ 'href': string = undefined;
|
|
|
+ @ApiProperty({ description: '排序' })
|
|
|
+ 'sort': number = undefined;
|
|
|
+ @ApiProperty({ description: '英文标题' })
|
|
|
+ 'English': string = undefined;
|
|
|
+ @ApiProperty({ description: '子菜单' })
|
|
|
+ 'children': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '备注' })
|
|
|
+ 'remark': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否使用' })
|
|
|
+ 'is_use': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_tags extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = ['title', 'type'];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ 'title': string = undefined;
|
|
|
+ @ApiProperty({ description: '类型' })
|
|
|
+ 'type': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QVO_tags extends FVO_tags {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class CDTO_tags {
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'title': string = undefined;
|
|
|
+ @ApiProperty({ description: '类型' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '路由' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'href': string = undefined;
|
|
|
+ @ApiProperty({ description: '英文标题' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'English': string = undefined;
|
|
|
+ @ApiProperty({ description: '排序' })
|
|
|
+ @Rule(RuleType['number']().empty(''))
|
|
|
+ 'sort': number = undefined;
|
|
|
+ @ApiProperty({ description: '子菜单' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'children': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '备注' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'remark': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否使用' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'is_use': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class CVO_tags extends FVO_tags {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class UDTO_tags extends CDTO_tags {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class UVAO_tags extends FVO_tags {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|