|
@@ -0,0 +1,128 @@
|
|
|
|
+import { Rule, RuleType } from '@midwayjs/validate';
|
|
|
|
+import { ApiProperty } from '@midwayjs/swagger';
|
|
|
|
+import {
|
|
|
|
+ FrameworkErrorEnum,
|
|
|
|
+ SearchBase,
|
|
|
|
+ ServiceError,
|
|
|
|
+} 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_nurse {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
|
+ _id: string = undefined;
|
|
|
|
+ @ApiProperty({ description: '名称' })
|
|
|
|
+ 'name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '头像' })
|
|
|
|
+ 'icon': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '手机' })
|
|
|
|
+ 'mobile': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '密码' })
|
|
|
|
+ 'password': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '医院名称' })
|
|
|
|
+ 'hos_name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '部门名称' })
|
|
|
|
+ 'dept_name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '所属医生' })
|
|
|
|
+ 'doctor': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '职务' })
|
|
|
|
+ 'title': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '职称' })
|
|
|
|
+ 'post': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
|
+ 'content': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '微信openid' })
|
|
|
|
+ 'openid': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
|
+ 'account': string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export class QDTO_nurse extends SearchBase {
|
|
|
|
+ constructor() {
|
|
|
|
+ const like_prop = [];
|
|
|
|
+ const props = ['name', 'account'];
|
|
|
|
+ const mapping = [];
|
|
|
|
+ super({ like_prop, props, mapping });
|
|
|
|
+ }
|
|
|
|
+ @ApiProperty({ description: '名称' })
|
|
|
|
+ 'name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
|
+ 'account': string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export class QVO_nurse extends FVO_nurse {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ super(data);
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export class CDTO_nurse {
|
|
|
|
+ @ApiProperty({ description: '名称' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '头像' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'icon': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '手机' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'mobile': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '密码' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'password': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '医院名称' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'hos_name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '部门名称' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'dept_name': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '所属医生' })
|
|
|
|
+ @Rule(
|
|
|
|
+ RuleType['string']()
|
|
|
|
+ .required()
|
|
|
|
+ .error(new ServiceError('缺少所属医生', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
+ )
|
|
|
|
+ 'doctor': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '职务' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'title': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '职称' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'post': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '简介' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'content': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '微信openid' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'openid': string = undefined;
|
|
|
|
+ @ApiProperty({ description: '账号' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ 'account': string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export class CVO_nurse extends FVO_nurse {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ super(data);
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export class UDTO_nurse extends CDTO_nurse {
|
|
|
|
+ @ApiProperty({ description: '数据id' })
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
|
|
+ _id: string = undefined;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export class UVAO_nurse extends FVO_nurse {
|
|
|
|
+ constructor(data: object) {
|
|
|
|
+ super(data);
|
|
|
|
+ dealVO(this, data);
|
|
|
|
+ }
|
|
|
|
+}
|