|
@@ -0,0 +1,129 @@
|
|
|
+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_project {
|
|
|
+ constructor(data: object) {
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '平台用户id' })
|
|
|
+ 'user': string = undefined;
|
|
|
+ @ApiProperty({ description: '名称' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '发布时间' })
|
|
|
+ 'time': string = undefined;
|
|
|
+ @ApiProperty({ description: '行业分类' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '成熟度' })
|
|
|
+ 'maturity': string = undefined;
|
|
|
+ @ApiProperty({ description: '技术类型' })
|
|
|
+ 'skill': string = undefined;
|
|
|
+ @ApiProperty({ description: '领域' })
|
|
|
+ 'field': string = undefined;
|
|
|
+ @ApiProperty({ description: '合作类型' })
|
|
|
+ 'cooperate': string = undefined;
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
+ 'brief': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否公开' })
|
|
|
+ 'is_use': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_project extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = ['name', 'time', 'type', 'maturity', 'skill', 'field', 'cooperate', 'status', 'is_use'];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '名称' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '发布时间' })
|
|
|
+ 'time': string = undefined;
|
|
|
+ @ApiProperty({ description: '行业分类' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '成熟度' })
|
|
|
+ 'maturity': string = undefined;
|
|
|
+ @ApiProperty({ description: '技术类型' })
|
|
|
+ 'skill': string = undefined;
|
|
|
+ @ApiProperty({ description: '领域' })
|
|
|
+ 'field': string = undefined;
|
|
|
+ @ApiProperty({ description: '合作类型' })
|
|
|
+ 'cooperate': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否公开' })
|
|
|
+ 'is_use': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QVO_project extends FVO_project {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class CDTO_project {
|
|
|
+ @ApiProperty({ description: '平台用户id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'user': string = undefined;
|
|
|
+ @ApiProperty({ description: '名称' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '发布时间' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'time': string = undefined;
|
|
|
+ @ApiProperty({ description: '行业分类' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '成熟度' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'maturity': string = undefined;
|
|
|
+ @ApiProperty({ description: '技术类型' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'skill': string = undefined;
|
|
|
+ @ApiProperty({ description: '领域' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'field': string = undefined;
|
|
|
+ @ApiProperty({ description: '合作类型' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'cooperate': string = undefined;
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'brief': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否公开' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'is_use': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class CVO_project extends FVO_project {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class UDTO_project extends CDTO_project {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class UVAO_project extends FVO_project {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|