|
@@ -0,0 +1,304 @@
|
|
|
+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: '用户类型' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '邀请码' })
|
|
|
+ 'code': string = undefined;
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
+ 'account': string = undefined;
|
|
|
+ @ApiProperty({ description: '密码' })
|
|
|
+ 'password': string = undefined;
|
|
|
+ @ApiProperty({ description: '姓名' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '手机号' })
|
|
|
+ 'phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '电子邮箱' })
|
|
|
+ 'email': string = undefined;
|
|
|
+ @ApiProperty({ description: '联系地址' })
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '办公电话' })
|
|
|
+ 'work_phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属行业' })
|
|
|
+ 'industry': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属辖区' })
|
|
|
+ 'area': string = undefined;
|
|
|
+ @ApiProperty({ description: '机构代码' })
|
|
|
+ 'institution_code': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册类型' })
|
|
|
+ 'companytype': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册时间' })
|
|
|
+ 'companydate': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册资金' })
|
|
|
+ 'companycapital': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业法人' })
|
|
|
+ 'companyperson': string = undefined;
|
|
|
+ @ApiProperty({ description: '上年度企业总收入' })
|
|
|
+ 'sndqyzsr': string = undefined;
|
|
|
+ @ApiProperty({ description: '上年度研发费用' })
|
|
|
+ 'sndyffy': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业总人数' })
|
|
|
+ 'companytotal': string = undefined;
|
|
|
+ @ApiProperty({ description: '专&兼职研发人数' })
|
|
|
+ 'zjzyfrs': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业简介' })
|
|
|
+ 'companybrief': string = undefined;
|
|
|
+ @ApiProperty({ description: '主要产品' })
|
|
|
+ 'mainproduct': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业资质&荣誉' })
|
|
|
+ 'qualifications': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class QDTO_company extends SearchBase {
|
|
|
+ constructor() {
|
|
|
+ const like_prop = [];
|
|
|
+ const props = [
|
|
|
+ 'type',
|
|
|
+ 'code',
|
|
|
+ 'account',
|
|
|
+ 'password',
|
|
|
+ 'name',
|
|
|
+ 'phone',
|
|
|
+ 'email',
|
|
|
+ 'address',
|
|
|
+ 'work_phone',
|
|
|
+ 'industry',
|
|
|
+ 'area',
|
|
|
+ 'institution_code',
|
|
|
+ 'status',
|
|
|
+ ];
|
|
|
+ const mapping = [];
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '用户类型' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '邀请码' })
|
|
|
+ 'code': string = undefined;
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
+ 'account': string = undefined;
|
|
|
+ @ApiProperty({ description: '密码' })
|
|
|
+ 'password': string = undefined;
|
|
|
+ @ApiProperty({ description: '姓名' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '手机号' })
|
|
|
+ 'phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '电子邮箱' })
|
|
|
+ 'email': string = undefined;
|
|
|
+ @ApiProperty({ description: '联系地址' })
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '办公电话' })
|
|
|
+ 'work_phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属行业' })
|
|
|
+ 'industry': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属辖区' })
|
|
|
+ 'area': string = undefined;
|
|
|
+ @ApiProperty({ description: '机构代码' })
|
|
|
+ 'institution_code': 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: '用户类型' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '邀请码' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'code': string = undefined;
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'account': string = undefined;
|
|
|
+ @ApiProperty({ description: '密码' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'password': string = undefined;
|
|
|
+ @ApiProperty({ description: '姓名' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '手机号' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '电子邮箱' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'email': string = undefined;
|
|
|
+ @ApiProperty({ description: '联系地址' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '办公电话' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'work_phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属行业' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'industry': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属辖区' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'area': string = undefined;
|
|
|
+ @ApiProperty({ description: '机构代码' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'institution_code': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册类型' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'companytype': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册时间' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'companydate': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册资金' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'companycapital': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业法人' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'companyperson': string = undefined;
|
|
|
+ @ApiProperty({ description: '上年度企业总收入' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'sndqyzsr': string = undefined;
|
|
|
+ @ApiProperty({ description: '上年度研发费用' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'sndyffy': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业总人数' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'companytotal': string = undefined;
|
|
|
+ @ApiProperty({ description: '专&兼职研发人数' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'zjzyfrs': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业简介' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'companybrief': string = undefined;
|
|
|
+ @ApiProperty({ description: '主要产品' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'mainproduct': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业资质&荣誉' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'qualifications': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+export class FetchVO_company {
|
|
|
+ constructor(data: object) {
|
|
|
+ for (const key of Object.keys(this)) {
|
|
|
+ this[key] = get(data, key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
+ 'account': string = undefined;
|
|
|
+ @ApiProperty({ description: '名称' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '角色' })
|
|
|
+ 'role': Array<any> = 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);
|
|
|
+ }
|
|
|
+}
|
|
|
+export class LoginVO {
|
|
|
+ constructor(data: object) {
|
|
|
+ for (const key of Object.keys(this)) {
|
|
|
+ this[key] = get(data, key);
|
|
|
+ }
|
|
|
+ this.type = '4';
|
|
|
+ }
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
+ _id: string = undefined;
|
|
|
+ @ApiProperty({ description: '用户类型' })
|
|
|
+ 'type': string = undefined;
|
|
|
+ @ApiProperty({ description: '邀请码' })
|
|
|
+ 'code': string = undefined;
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
+ 'account': string = undefined;
|
|
|
+ @ApiProperty({ description: '密码' })
|
|
|
+ 'password': string = undefined;
|
|
|
+ @ApiProperty({ description: '姓名' })
|
|
|
+ 'name': string = undefined;
|
|
|
+ @ApiProperty({ description: '手机号' })
|
|
|
+ 'phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '电子邮箱' })
|
|
|
+ 'email': string = undefined;
|
|
|
+ @ApiProperty({ description: '联系地址' })
|
|
|
+ 'address': string = undefined;
|
|
|
+ @ApiProperty({ description: '办公电话' })
|
|
|
+ 'work_phone': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属行业' })
|
|
|
+ 'industry': string = undefined;
|
|
|
+ @ApiProperty({ description: '所属辖区' })
|
|
|
+ 'area': string = undefined;
|
|
|
+ @ApiProperty({ description: '机构代码' })
|
|
|
+ 'institution_code': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册类型' })
|
|
|
+ 'companytype': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册时间' })
|
|
|
+ 'companydate': string = undefined;
|
|
|
+ @ApiProperty({ description: '注册资金' })
|
|
|
+ 'companycapital': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业法人' })
|
|
|
+ 'companyperson': string = undefined;
|
|
|
+ @ApiProperty({ description: '上年度企业总收入' })
|
|
|
+ 'sndqyzsr': string = undefined;
|
|
|
+ @ApiProperty({ description: '上年度研发费用' })
|
|
|
+ 'sndyffy': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业总人数' })
|
|
|
+ 'companytotal': string = undefined;
|
|
|
+ @ApiProperty({ description: '专&兼职研发人数' })
|
|
|
+ 'zjzyfrs': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业简介' })
|
|
|
+ 'companybrief': string = undefined;
|
|
|
+ @ApiProperty({ description: '主要产品' })
|
|
|
+ 'mainproduct': string = undefined;
|
|
|
+ @ApiProperty({ description: '企业资质&荣誉' })
|
|
|
+ 'qualifications': string = undefined;
|
|
|
+ @ApiProperty({ description: '状态' })
|
|
|
+ 'status': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class LoginDTO {
|
|
|
+ @ApiProperty({ description: '账号', example: 'test' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'account': string = undefined;
|
|
|
+ @ApiProperty({ description: '密码', example: '111111' })
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
+ 'password': string = undefined;
|
|
|
+}
|
|
|
+
|
|
|
+export class ResetPasswordDTO {
|
|
|
+ @ApiProperty({ description: '密码', example: '123456' })
|
|
|
+ @Rule(RuleType['string']().required())
|
|
|
+ 'password': string = undefined;
|
|
|
+}
|