123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- 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_personal {
- 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: '身份证号' })
- 'card': string = undefined;
- @ApiProperty({ description: '职务职称' })
- 'zwzc': string = undefined;
- @ApiProperty({ description: '所在院系' })
- 'school': string = undefined;
- @ApiProperty({ description: '所学专业' })
- 'major': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QDTO_personal extends SearchBase {
- constructor() {
- const like_prop = [];
- const props = [
- 'type',
- 'code',
- 'account',
- 'password',
- 'name',
- 'phone',
- 'email',
- 'address',
- 'work_phone',
- 'industry',
- 'area',
- 'card',
- 'zwzc',
- 'school',
- 'major',
- '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: '身份证号' })
- 'card': string = undefined;
- @ApiProperty({ description: '职务职称' })
- 'zwzc': string = undefined;
- @ApiProperty({ description: '所在院系' })
- 'school': string = undefined;
- @ApiProperty({ description: '所学专业' })
- 'major': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QVO_personal extends FVO_personal {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_personal {
- @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(''))
- 'card': string = undefined;
- @ApiProperty({ description: '职务职称' })
- @Rule(RuleType['string']().empty(''))
- 'zwzc': string = undefined;
- @ApiProperty({ description: '所在院系' })
- @Rule(RuleType['string']().empty(''))
- 'school': string = undefined;
- @ApiProperty({ description: '所学专业' })
- @Rule(RuleType['string']().empty(''))
- 'major': string = undefined;
- @ApiProperty({ description: '状态' })
- @Rule(RuleType['string']().empty(''))
- 'status': string = undefined;
- }
- export class CVO_personal extends FVO_personal {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_personal extends CDTO_personal {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_personal extends FVO_personal {
- 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: '身份证号' })
- 'card': string = undefined;
- @ApiProperty({ description: '职务职称' })
- 'zwzc': string = undefined;
- @ApiProperty({ description: '所在院系' })
- 'school': string = undefined;
- @ApiProperty({ description: '所学专业' })
- 'major': 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;
- }
|