|
@@ -1,10 +1,6 @@
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
import { ApiProperty } from '@midwayjs/swagger';
|
|
import { ApiProperty } from '@midwayjs/swagger';
|
|
-import {
|
|
|
|
- FrameworkErrorEnum,
|
|
|
|
- SearchBase,
|
|
|
|
- ServiceError,
|
|
|
|
-} from 'free-midway-component';
|
|
|
|
|
|
+import { SearchBase } from 'free-midway-component';
|
|
import get = require('lodash/get');
|
|
import get = require('lodash/get');
|
|
const dealVO = (cla, data) => {
|
|
const dealVO = (cla, data) => {
|
|
for (const key in cla) {
|
|
for (const key in cla) {
|
|
@@ -40,7 +36,7 @@ export class FVO_User {
|
|
|
|
|
|
export class QDTO_User extends SearchBase {
|
|
export class QDTO_User extends SearchBase {
|
|
constructor() {
|
|
constructor() {
|
|
- const like_prop = [];
|
|
|
|
|
|
+ const like_prop = ['name'];
|
|
const props = [
|
|
const props = [
|
|
'name',
|
|
'name',
|
|
'tel',
|
|
'tel',
|
|
@@ -81,35 +77,19 @@ export class QVO_User extends FVO_User {
|
|
|
|
|
|
export class CDTO_User {
|
|
export class CDTO_User {
|
|
@ApiProperty({ description: '姓名' })
|
|
@ApiProperty({ description: '姓名' })
|
|
- @Rule(
|
|
|
|
- RuleType['string']()
|
|
|
|
- .required()
|
|
|
|
- .error(new ServiceError('缺少姓名', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
- )
|
|
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
'name': string = undefined;
|
|
'name': string = undefined;
|
|
@ApiProperty({ description: '联系电话' })
|
|
@ApiProperty({ description: '联系电话' })
|
|
- @Rule(
|
|
|
|
- RuleType['string']()
|
|
|
|
- .required()
|
|
|
|
- .error(new ServiceError('缺少联系电话', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
- )
|
|
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
'tel': string = undefined;
|
|
'tel': string = undefined;
|
|
@ApiProperty({ description: '密码' })
|
|
@ApiProperty({ description: '密码' })
|
|
@Rule(RuleType['string']().empty(''))
|
|
@Rule(RuleType['string']().empty(''))
|
|
'password': string = undefined;
|
|
'password': string = undefined;
|
|
@ApiProperty({ description: '性别' })
|
|
@ApiProperty({ description: '性别' })
|
|
- @Rule(
|
|
|
|
- RuleType['string']()
|
|
|
|
- .required()
|
|
|
|
- .error(new ServiceError('缺少性别', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
- )
|
|
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
'gender': string = undefined;
|
|
'gender': string = undefined;
|
|
@ApiProperty({ description: '角色' })
|
|
@ApiProperty({ description: '角色' })
|
|
- @Rule(
|
|
|
|
- RuleType['string']()
|
|
|
|
- .required()
|
|
|
|
- .error(new ServiceError('缺少角色', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
- )
|
|
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
'role': string = undefined;
|
|
'role': string = undefined;
|
|
@ApiProperty({ description: '所属街道' })
|
|
@ApiProperty({ description: '所属街道' })
|
|
@Rule(RuleType['string']().empty(''))
|
|
@Rule(RuleType['string']().empty(''))
|
|
@@ -118,18 +98,10 @@ export class CDTO_User {
|
|
@Rule(RuleType['string']().empty(''))
|
|
@Rule(RuleType['string']().empty(''))
|
|
'community': string = undefined;
|
|
'community': string = undefined;
|
|
@ApiProperty({ description: '微信id' })
|
|
@ApiProperty({ description: '微信id' })
|
|
- @Rule(
|
|
|
|
- RuleType['string']()
|
|
|
|
- .required()
|
|
|
|
- .error(new ServiceError('缺少微信id', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
- )
|
|
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
'openid': string = undefined;
|
|
'openid': string = undefined;
|
|
@ApiProperty({ description: '状态' })
|
|
@ApiProperty({ description: '状态' })
|
|
- @Rule(
|
|
|
|
- RuleType['string']()
|
|
|
|
- .required()
|
|
|
|
- .error(new ServiceError('缺少状态', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
- )
|
|
|
|
|
|
+ @Rule(RuleType['string']().empty(''))
|
|
'status': string = undefined;
|
|
'status': string = undefined;
|
|
}
|
|
}
|
|
|
|
|