|
@@ -0,0 +1,112 @@
|
|
|
+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_dataRecord {
|
|
|
+ constructor(data: object) {
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '操作人' })
|
|
|
+ 'operator': object = undefined;
|
|
|
+ @ApiProperty({ description: 'ip地址' })
|
|
|
+ 'ip': string = undefined;
|
|
|
+ @ApiProperty({ description: '时间' })
|
|
|
+ 'time': string = undefined;
|
|
|
+ @ApiProperty({ description: '对象' })
|
|
|
+ 'controller': string = undefined;
|
|
|
+ @ApiProperty({ description: '函数' })
|
|
|
+ 'method': string = undefined;
|
|
|
+ @ApiProperty({ description: '原数据' })
|
|
|
+ 'origin_data': object = undefined;
|
|
|
+ @ApiProperty({ description: '新数据' })
|
|
|
+ 'new_data': object = undefined;
|
|
|
+ @ApiProperty({ description: '页面路由' })
|
|
|
+ 'router': string = undefined;
|
|
|
+ @ApiProperty({ description: '设备' })
|
|
|
+ 'device': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class QDTO_dataRecord extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = [];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class QVO_dataRecord extends FVO_dataRecord {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class CDTO_dataRecord {
|
|
|
+ @ApiProperty({ description: '操作人' })
|
|
|
+@Rule(RuleType['object']().empty(''))
|
|
|
+ 'operator': object = undefined;
|
|
|
+ @ApiProperty({ description: 'ip地址' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'ip': string = undefined;
|
|
|
+ @ApiProperty({ description: '时间' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'time': string = undefined;
|
|
|
+ @ApiProperty({ description: '对象' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'controller': string = undefined;
|
|
|
+ @ApiProperty({ description: '函数' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'method': string = undefined;
|
|
|
+ @ApiProperty({ description: '原数据' })
|
|
|
+@Rule(RuleType['object']().empty(''))
|
|
|
+ 'origin_data': object = undefined;
|
|
|
+ @ApiProperty({ description: '新数据' })
|
|
|
+@Rule(RuleType['object']().empty(''))
|
|
|
+ 'new_data': object = undefined;
|
|
|
+ @ApiProperty({ description: '页面路由' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'router': string = undefined;
|
|
|
+ @ApiProperty({ description: '设备' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'device': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+@Rule(RuleType['string']().empty(''))
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class CVO_dataRecord extends FVO_dataRecord {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class UDTO_dataRecord extends CDTO_dataRecord {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class UVAO_dataRecord extends FVO_dataRecord {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|