123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- 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: '姓名' })
- 'name': string = undefined;
- @ApiProperty({ description: '联系电话' })
- 'tel': string = undefined;
- @ApiProperty({ description: '密码' })
- 'password': string = undefined;
- @ApiProperty({ description: '性别' })
- 'gender': string = undefined;
- @ApiProperty({ description: '角色' })
- 'role': string = undefined;
- @ApiProperty({ description: '所属街道' })
- 'street': string = undefined;
- @ApiProperty({ description: '所属社区' })
- 'community': string = undefined;
- @ApiProperty({ description: '创建时间' })
- 'create_time': string = undefined;
- @ApiProperty({ description: '微信id' })
- 'openid': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class QDTO_User extends SearchBase {
- constructor() {
- const like_prop = ['name'];
- const props = [
- 'name',
- 'tel',
- 'gender',
- 'role',
- 'street',
- 'community',
- 'openid',
- 'create_time',
- 'status',
- ];
- const mapping = [];
- super({ like_prop, props, mapping });
- }
- @ApiProperty({ description: '姓名' })
- 'name': string = undefined;
- @ApiProperty({ description: '联系电话' })
- 'tel': string = undefined;
- @ApiProperty({ description: '性别' })
- 'gender': string = undefined;
- @ApiProperty({ description: '角色' })
- 'role': string = undefined;
- @ApiProperty({ description: '所属街道' })
- 'street': string = undefined;
- @ApiProperty({ description: '所属社区' })
- 'community': string = undefined;
- @ApiProperty({ description: '微信id' })
- 'openid': string = undefined;
- @ApiProperty({ description: '创建时间' })
- 'create_time': 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: '姓名' })
- @Rule(RuleType['string']().empty(''))
- 'name': string = undefined;
- @ApiProperty({ description: '联系电话' })
- @Rule(RuleType['string']().empty(''))
- 'tel': string = undefined;
- @ApiProperty({ description: '密码' })
- @Rule(RuleType['string']().empty(''))
- 'password': string = undefined;
- @ApiProperty({ description: '性别' })
- @Rule(RuleType['string']().empty(''))
- 'gender': string = undefined;
- @ApiProperty({ description: '角色' })
- @Rule(RuleType['string']().empty(''))
- 'role': string = undefined;
- @ApiProperty({ description: '所属街道' })
- @Rule(RuleType['string']().empty(''))
- 'street': string = undefined;
- @ApiProperty({ description: '所属社区' })
- @Rule(RuleType['string']().empty(''))
- 'community': string = undefined;
- @ApiProperty({ description: '创建时间' })
- @Rule(RuleType['string']().empty(''))
- 'create_time': string = undefined;
- @ApiProperty({ description: '微信id' })
- @Rule(RuleType['string']().empty(''))
- 'openid': string = undefined;
- @ApiProperty({ description: '状态' })
- @Rule(RuleType['string']().empty(''))
- 'status': 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: '姓名' })
- 'name': string = undefined;
- @ApiProperty({ description: '联系电话' })
- 'tel': string = undefined;
- @ApiProperty({ description: '性别' })
- 'gender': string = undefined;
- @ApiProperty({ description: '角色' })
- 'role': string = undefined;
- @ApiProperty({ description: '所属街道' })
- 'street': string = undefined;
- @ApiProperty({ description: '所属社区' })
- 'community': string = undefined;
- @ApiProperty({ description: '微信id' })
- 'openid': string = undefined;
- @ApiProperty({ description: '状态' })
- 'status': string = undefined;
- }
- export class LoginDTO {
- @ApiProperty({ description: '电话号', example: '18843520013' })
- @Rule(RuleType['string']().empty(''))
- 'tel': 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;
- }
|