123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- 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_user {
- constructor(data: object) {
- dealVO(this, data);
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: 'openid' })
- 'openid': string = undefined;
- @ApiProperty({ description: '类别' })
- 'type': string = undefined;
- @ApiProperty({ description: '名称' })
- 'name': string = undefined;
- @ApiProperty({ description: '账号' })
- 'account': string = undefined;
- @ApiProperty({ description: '密码' })
- 'password': string = undefined;
- @ApiProperty({ description: '手机号' })
- 'phone': string = undefined;
- @ApiProperty({ description: '邮箱' })
- 'email': string = undefined;
- @ApiProperty({ description: '性别' })
- 'gender': string = undefined;
- @ApiProperty({ description: '头像' })
- 'icon': Array<any> = undefined;
- @ApiProperty({ description: '年龄' })
- 'age': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- @ApiProperty({ description: '工作单位' })
- 'work': string = undefined;
- }
- export class QDTO_user extends SearchBase {
- constructor() {
- const like_prop = ['name'];
- const props = [
- 'openid',
- 'type',
- 'name',
- 'account',
- 'phone',
- 'age',
- 'status',
- ];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: 'openid' })
- 'openid': string = undefined;
- @ApiProperty({ description: '类别' })
- 'type': string = undefined;
- @ApiProperty({ description: '名称' })
- 'name': string = undefined;
- @ApiProperty({ description: '账号' })
- 'account': string = undefined;
- @ApiProperty({ description: '手机号' })
- 'phone': string = undefined;
- @ApiProperty({ description: '年龄' })
- 'age': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QVO_user extends FVO_user {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class CDTO_user {
- @ApiProperty({ description: 'openid' })
- @Rule(RuleType['string']().empty(''))
- 'openid': string = undefined;
- @ApiProperty({ description: '类别' })
- @Rule(RuleType['string']().empty(''))
- 'type': string = undefined;
- @ApiProperty({ description: '名称' })
- @Rule(RuleType['string']().empty(''))
- 'name': 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(''))
- 'phone': string = undefined;
- @ApiProperty({ description: '邮箱' })
- @Rule(RuleType['string']().empty(''))
- 'email': string = undefined;
- @ApiProperty({ description: '性别' })
- @Rule(RuleType['string']().empty(''))
- 'gender': string = undefined;
- @ApiProperty({ description: '头像' })
- @Rule(RuleType['array']().empty(''))
- 'icon': Array<any> = undefined;
- @ApiProperty({ description: '年龄' })
- @Rule(RuleType['string']().empty(''))
- 'age': string = undefined;
- @ApiProperty({ description: '状态' })
- @Rule(RuleType['string']().empty(''))
- 'status': string = undefined;
- @ApiProperty({ description: '工作单位' })
- @Rule(RuleType['string']().empty(''))
- 'work': string = undefined;
- }
- export class CVO_user extends FVO_user {
- constructor(data: object) {
- super(data);
- dealVO(this, data);
- }
- }
- export class UDTO_user extends CDTO_user {
- @ApiProperty({ description: '数据id' })
- @Rule(RuleType['string']().empty(''))
- _id: string = undefined;
- }
- export class UVAO_user extends FVO_user {
- 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);
- }
- }
- @ApiProperty({ description: '数据id' })
- _id: string = undefined;
- @ApiProperty({ description: 'openid' })
- 'openid': string = undefined;
- @ApiProperty({ description: '类别' })
- 'type': string = undefined;
- @ApiProperty({ description: '名称' })
- 'name': string = undefined;
- @ApiProperty({ description: '账号' })
- 'account': string = undefined;
- @ApiProperty({ description: '手机号' })
- 'phone': string = undefined;
- @ApiProperty({ description: '邮箱' })
- 'email': string = undefined;
- @ApiProperty({ description: '性别' })
- 'gender': string = undefined;
- @ApiProperty({ description: '头像' })
- 'icon': Array<any> = undefined;
- @ApiProperty({ description: '年龄' })
- 'age': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- @ApiProperty({ description: '工作单位' })
- 'work': 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: '用户id', example: '' })
- @Rule(RuleType['string']().required())
- '_id': string = undefined;
- @ApiProperty({ description: '密码', example: '123456' })
- @Rule(RuleType['string']().required())
- 'password': string = undefined;
- }
|