import { Rule, RuleType } from "@midwayjs/validate"; import { get } from "lodash"; /**分页处理参数 */ export interface PageOptions { skip?: number; limit?: number; sort?: object; [propName: string]: any; } /**对查询结果处理参数 */ export interface ResultOptions { lean?: boolean; populate?: boolean; [propName: string]: any; } export enum LoginType { Admin = 'Admin', } /**登录后token返回参数 */ export class LoginVO { constructor(data: object) { this._id = get(data, '_id'); this.nick_name = get(data, 'nick_name'); this.openid = get(data, 'openid'); this.role = get(data, 'role'); this.is_super = get(data, 'is_super'); } _id: string; nick_name: string; openid: string; role: string; is_super: string; } /**修改密码接收对象 */ export class UPwdDTO { // @ApiProperty({ description: '用户数据id' }) @Rule(RuleType['string']().required()) _id: string = undefined; // @ApiProperty({ description: '密码' }) @Rule(RuleType['string']().required()) password: string = undefined; }