|
@@ -0,0 +1,154 @@
|
|
|
|
+
|
|
|
|
+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_builddesire {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
|
+ _id: string = undefined;
|
|
|
|
+ @ApiProperty({ description: '绑定用户' })
|
|
|
|
+ 'user_id': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位id' })
|
|
|
|
+ 'company_id': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位名称' })
|
|
|
|
+ 'company_name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位所在地' })
|
|
|
|
+ 'address': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位性质' })
|
|
|
|
+ 'nature': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '拟解决技术难题或战略发展问题' })
|
|
|
|
+ 'development': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '所属领域' })
|
|
|
|
+ 'fields': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '建设目标' })
|
|
|
|
+ 'target': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '联系人' })
|
|
|
|
+ 'contact': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '联系电话' })
|
|
|
|
+ 'phone': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '专业技术职称' })
|
|
|
|
+ 'zc': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '专业领域' })
|
|
|
|
+ 'zy_fields': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '研究方向' })
|
|
|
|
+ 'direction': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '其它要求' })
|
|
|
|
+ 'other': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '是否启用' })
|
|
|
|
+ 'is_use': string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export class QDTO_builddesire extends SearchBase {
|
|
|
|
+ constructor() {
|
|
|
|
+ const like_prop = [];
|
|
|
|
+ const props = ['user_id', 'company_id', 'company_name', 'nature', 'fields', 'contact', 'zc', 'is_use'];
|
|
|
|
+ const mapping = [];
|
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
|
+ }
|
|
|
|
+ @ApiProperty({ description: '绑定用户' })
|
|
|
|
+ 'user_id': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位id' })
|
|
|
|
+ 'company_id': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位名称' })
|
|
|
|
+ 'company_name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位性质' })
|
|
|
|
+ 'nature': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '所属领域' })
|
|
|
|
+ 'fields': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '联系人' })
|
|
|
|
+ 'contact': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '专业技术职称' })
|
|
|
|
+ 'zc': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '是否启用' })
|
|
|
|
+ 'is_use': string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export class QVO_builddesire extends FVO_builddesire {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ super(data);
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export class CDTO_builddesire {
|
|
|
|
+ @ApiProperty({ description: '绑定用户' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'user_id': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位id' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'company_id': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位名称' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'company_name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位所在地' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'address': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '单位性质' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'nature': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '拟解决技术难题或战略发展问题' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'development': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '所属领域' })
|
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
|
+ 'fields': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '建设目标' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'target': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '联系人' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'contact': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '联系电话' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'phone': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '专业技术职称' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'zc': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '专业领域' })
|
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
|
+ 'zy_fields': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '研究方向' })
|
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
|
+ 'direction': Array<any> = undefined;
|
|
|
|
+ @ApiProperty({ description: '其它要求' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'other': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '是否启用' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'is_use': string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export class CVO_builddesire extends FVO_builddesire {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ super(data);
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export class UDTO_builddesire extends CDTO_builddesire {
|
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ _id: string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export class UVAO_builddesire extends FVO_builddesire {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ super(data);
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+}
|