|
@@ -0,0 +1,159 @@
|
|
|
+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_company {
|
|
|
+ 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: 'logo' })
|
|
|
+ 'logo': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '企业标签' })
|
|
|
+ 'tags': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '统一信用代码' })
|
|
|
+ 'code': string = undefined;
|
|
|
+ @ApiProperty({ description: '联系电话' })
|
|
|
+ 'phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属行业' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '法定代表人' })
|
|
|
+ 'representative': string = undefined;
|
|
|
+ @ApiProperty({ description: '电子邮箱' })
|
|
|
+ 'email': string = undefined;
|
|
|
+ @ApiProperty({ description: '员工人数' })
|
|
|
+ 'person': number = undefined;
|
|
|
+ @ApiProperty({ description: '注册资本' })
|
|
|
+ 'register': string = undefined;
|
|
|
+ @ApiProperty({ description: '成立日期' })
|
|
|
+ 'create_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '更新时间' })
|
|
|
+ 'update_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '地址' })
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
+ 'brief': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否公开' })
|
|
|
+ 'is_show': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_company extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = ['user', 'name', 'tags', 'phone', 'type', 'person', 'update_time', 'is_show', 'status'];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '平台用户id' })
|
|
|
+ 'user': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业名称' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业标签' })
|
|
|
+ 'tags': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '联系电话' })
|
|
|
+ 'phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属行业' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '员工人数' })
|
|
|
+ 'person': number = undefined;
|
|
|
+ @ApiProperty({ description: '更新时间' })
|
|
|
+ 'update_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否公开' })
|
|
|
+ 'is_show': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QVO_company extends FVO_company {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class CDTO_company {
|
|
|
+ @ApiProperty({ description: '平台用户id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'user': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业名称' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: 'logo' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'logo': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '企业标签' })
|
|
|
+ @Rule(RuleType['array']().empty(''))
|
|
|
+ 'tags': Array<any> = undefined;
|
|
|
+ @ApiProperty({ description: '统一信用代码' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'code': string = undefined;
|
|
|
+ @ApiProperty({ description: '联系电话' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属行业' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '法定代表人' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'representative': string = undefined;
|
|
|
+ @ApiProperty({ description: '电子邮箱' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'email': string = undefined;
|
|
|
+ @ApiProperty({ description: '员工人数' })
|
|
|
+ @Rule(RuleType['number']().empty(''))
|
|
|
+ 'person': number = undefined;
|
|
|
+ @ApiProperty({ description: '注册资本' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'register': string = undefined;
|
|
|
+ @ApiProperty({ description: '成立日期' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'create_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '更新时间' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'update_time': string = undefined;
|
|
|
+ @ApiProperty({ description: '地址' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'brief': string = undefined;
|
|
|
+ @ApiProperty({ description: '是否公开' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'is_show': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class CVO_company extends FVO_company {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class UDTO_company extends CDTO_company {
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ _id: string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class UVAO_company extends FVO_company {
|
|
|
+ constructor(data: object) {
|
|
|
+ super(data);
|
|
|
+ dealVO(this, data);
|
|
|
+ }
|
|
|
+}
|