|
@@ -1,6 +1,10 @@
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
import { ApiProperty } from '@midwayjs/swagger';
|
|
import { ApiProperty } from '@midwayjs/swagger';
|
|
-import { SearchBase } from 'free-midway-component';
|
|
|
|
|
|
+import {
|
|
|
|
+ FrameworkErrorEnum,
|
|
|
|
+ SearchBase,
|
|
|
|
+ ServiceError,
|
|
|
|
+} 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) {
|
|
@@ -14,10 +18,8 @@ export class FVO_ShopSetting {
|
|
}
|
|
}
|
|
@ApiProperty({ description: '数据id' })
|
|
@ApiProperty({ description: '数据id' })
|
|
_id: string = undefined;
|
|
_id: string = undefined;
|
|
- @ApiProperty({ description: '街道' })
|
|
|
|
- 'street': string = undefined;
|
|
|
|
- @ApiProperty({ description: '社区' })
|
|
|
|
- 'community': string = undefined;
|
|
|
|
|
|
+ @ApiProperty({ description: '街道/社区' })
|
|
|
|
+ 'office': string = undefined;
|
|
@ApiProperty({ description: '领导' })
|
|
@ApiProperty({ description: '领导' })
|
|
'leader': Array<any> = undefined;
|
|
'leader': Array<any> = undefined;
|
|
@ApiProperty({ description: '会计' })
|
|
@ApiProperty({ description: '会计' })
|
|
@@ -29,14 +31,12 @@ export class FVO_ShopSetting {
|
|
export class QDTO_ShopSetting extends SearchBase {
|
|
export class QDTO_ShopSetting extends SearchBase {
|
|
constructor() {
|
|
constructor() {
|
|
const like_prop = [];
|
|
const like_prop = [];
|
|
- const props = ['street', 'community', 'is_use'];
|
|
|
|
|
|
+ const props = ['office', 'is_use'];
|
|
const mapping = [];
|
|
const mapping = [];
|
|
super({ like_prop, props, mapping });
|
|
super({ like_prop, props, mapping });
|
|
}
|
|
}
|
|
- @ApiProperty({ description: '街道' })
|
|
|
|
- 'street': string = undefined;
|
|
|
|
- @ApiProperty({ description: '社区' })
|
|
|
|
- 'community': string = undefined;
|
|
|
|
|
|
+ @ApiProperty({ description: '街道/社区' })
|
|
|
|
+ 'office': string = undefined;
|
|
@ApiProperty({ description: '是否使用' })
|
|
@ApiProperty({ description: '是否使用' })
|
|
'is_use': string = undefined;
|
|
'is_use': string = undefined;
|
|
}
|
|
}
|
|
@@ -49,17 +49,26 @@ export class QVO_ShopSetting extends FVO_ShopSetting {
|
|
}
|
|
}
|
|
|
|
|
|
export class CDTO_ShopSetting {
|
|
export class CDTO_ShopSetting {
|
|
- @ApiProperty({ description: '街道' })
|
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
|
- 'street': string = undefined;
|
|
|
|
- @ApiProperty({ description: '社区' })
|
|
|
|
- @Rule(RuleType['string']().empty(''))
|
|
|
|
- 'community': string = undefined;
|
|
|
|
|
|
+ @ApiProperty({ description: '街道/社区' })
|
|
|
|
+ @Rule(
|
|
|
|
+ RuleType['string']()
|
|
|
|
+ .required()
|
|
|
|
+ .error(new ServiceError('缺少街道/社区', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
+ )
|
|
|
|
+ 'office': string = undefined;
|
|
@ApiProperty({ description: '领导' })
|
|
@ApiProperty({ description: '领导' })
|
|
- @Rule(RuleType['array']().empty(''))
|
|
|
|
|
|
+ @Rule(
|
|
|
|
+ RuleType['array']()
|
|
|
|
+ .required()
|
|
|
|
+ .error(new ServiceError('缺少领导', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
+ )
|
|
'leader': Array<any> = undefined;
|
|
'leader': Array<any> = undefined;
|
|
@ApiProperty({ description: '会计' })
|
|
@ApiProperty({ description: '会计' })
|
|
- @Rule(RuleType['array']().empty(''))
|
|
|
|
|
|
+ @Rule(
|
|
|
|
+ RuleType['array']()
|
|
|
|
+ .required()
|
|
|
|
+ .error(new ServiceError('缺少会计', FrameworkErrorEnum.NEED_BODY))
|
|
|
|
+ )
|
|
'accounting': Array<any> = undefined;
|
|
'accounting': Array<any> = undefined;
|
|
@ApiProperty({ description: '是否使用' })
|
|
@ApiProperty({ description: '是否使用' })
|
|
@Rule(RuleType['string']().empty(''))
|
|
@Rule(RuleType['string']().empty(''))
|