123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import { modelOptions, prop } from '@typegoose/typegoose';
- import { BaseModel } from 'free-midway-component';
- import isString = require('lodash/isString');
- @modelOptions({
- schemaOptions: { collection: 'User' },
- })
- export class User extends BaseModel {
- @prop({ required: true, index: true, zh: '姓名' })
- name: string;
- @prop({ required: true, index: true, zh: '联系电话' })
- tel: string;
- @prop({
- required: false,
- index: false,
- zh: '密码',
- select: false,
- set: (val: string | object) => {
- if (isString(val)) {
- return { secret: val };
- }
- return val;
- },
- })
- password: {
- secret: string;
- };
- @prop({
- required: false,
- index: true,
- zh: '性别',
- remark: '0:男;1女;2未知',
- default: '2',
- })
- gender: string;
- @prop({ required: false, index: true, zh: '角色' })
- role: string;
- @prop({ required: false, index: true, zh: '所属街道' })
- street: string;
- @prop({ required: false, index: false, zh: '所属社区' })
- community: string;
- @prop({ required: false, index: true, zh: '微信id' })
- openid: string;
- @prop({
- required: false,
- index: true,
- zh: '状态',
- remark: '0-待审核;1-审核成功;2-审核失败',
- default: '0',
- })
- status: string;
- }
|