|
@@ -0,0 +1,99 @@
|
|
|
+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_message {
|
|
|
+ constructor(data: object) {
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '绑定用户' })
|
|
|
+ 'user_id': string = undefined;
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ 'title': string = undefined;
|
|
|
+ @ApiProperty({ description: '发送时间' })
|
|
|
+ 'send_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '接收人类型' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '接收人' })
|
|
|
+ 'user': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '信息文件' })
|
|
|
+ 'file': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '信息内容' })
|
|
|
+ 'content': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_message extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = ['user_id', 'title', 'send_time', 'type'];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '绑定用户' })
|
|
|
+ 'user_id': string = undefined;
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ 'title': string = undefined;
|
|
|
+ @ApiProperty({ description: '发送时间' })
|
|
|
+ 'send_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '接收人类型' })
|
|
|
+ 'type': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QVO_message extends FVO_message {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class CDTO_message {
|
|
|
+ @ApiProperty({ description: '绑定用户' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'user_id': string = undefined;
|
|
|
+ @ApiProperty({ description: '标题' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'title': string = undefined;
|
|
|
+ @ApiProperty({ description: '发送时间' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'send_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '接收人类型' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '接收人' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'user': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '信息文件' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'file': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '信息内容' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'content': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class CVO_message extends FVO_message {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class UDTO_message extends CDTO_message {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class UVAO_message extends FVO_message {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|