|
@@ -0,0 +1,130 @@
|
|
|
+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_achieve {
|
|
|
+ constructor(data: object) {
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '所属人' })
|
|
|
+ 'owner': string = undefined;
|
|
|
+ @ApiProperty({ description: '成果名称' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '行业分类' })
|
|
|
+ 'industry': string = undefined;
|
|
|
+ @ApiProperty({ description: '成果属性' })
|
|
|
+ 'attr': string = undefined;
|
|
|
+ @ApiProperty({ description: '出让方式' })
|
|
|
+ 'way': string = undefined;
|
|
|
+ @ApiProperty({ description: '成熟度' })
|
|
|
+ 'maturity': string = undefined;
|
|
|
+ @ApiProperty({ description: '技术分类' })
|
|
|
+ 'tech': string = undefined;
|
|
|
+ @ApiProperty({ description: '成果地区' })
|
|
|
+ 'area': string = undefined;
|
|
|
+ @ApiProperty({ description: '发布时间' })
|
|
|
+ 'time': string = undefined;
|
|
|
+ @ApiProperty({ description: '交易金额' })
|
|
|
+ 'money': string = undefined;
|
|
|
+ @ApiProperty({ description: '公开信息' })
|
|
|
+ 'public_info': object = undefined;
|
|
|
+ @ApiProperty({ description: '附件' })
|
|
|
+ 'files': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '成果描述' })
|
|
|
+ 'desc': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_achieve extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = ['name'];
|
|
|
+ const props = ['owner', 'name', 'industry', 'attr', 'way', 'maturity', 'tech', 'area', 'money', 'status', 'industry[]'];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '所属人' })
|
|
|
+ 'owner': string = undefined;
|
|
|
+ @ApiProperty({ description: '成果名称' })
|
|
|
+ 'name': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QVO_achieve extends FVO_achieve {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class CDTO_achieve {
|
|
|
+ @ApiProperty({ description: '所属人' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'owner': string = undefined;
|
|
|
+ @ApiProperty({ description: '成果名称' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '行业分类' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'industry': string = undefined;
|
|
|
+ @ApiProperty({ description: '成果属性' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'attr': string = undefined;
|
|
|
+ @ApiProperty({ description: '出让方式' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'way': string = undefined;
|
|
|
+ @ApiProperty({ description: '成熟度' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'maturity': string = undefined;
|
|
|
+ @ApiProperty({ description: '技术分类' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'tech': string = undefined;
|
|
|
+ @ApiProperty({ description: '成果地区' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'area': string = undefined;
|
|
|
+ @ApiProperty({ description: '发布时间' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'time': string = undefined;
|
|
|
+ @ApiProperty({ description: '交易金额' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'money': string = undefined;
|
|
|
+ @ApiProperty({ description: '公开信息' })
|
|
|
+ @Rule(RuleType['object']().empty(''))
|
|
|
+ 'public_info': object = undefined;
|
|
|
+ @ApiProperty({ description: '附件' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'files': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '成果描述' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'desc': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class CVO_achieve extends FVO_achieve {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class UDTO_achieve extends CDTO_achieve {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class UVAO_achieve extends FVO_achieve {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|