diff --git a/src/models/bo/property.ts b/src/models/bo/property.ts index f5297b2..d0ca8b8 100644 --- a/src/models/bo/property.ts +++ b/src/models/bo/property.ts @@ -33,7 +33,7 @@ export default class Property extends Model { @AllowNull(false) @Column({ - type: DataType.ENUM(TYPES.STRING, TYPES.NUMBER, TYPES.BOOLEAN, TYPES.OBJECT, TYPES.ARRAY, TYPES.FUNCTION, TYPES.REGEXP), + type: DataType.ENUM(TYPES.STRING, TYPES.NUMBER, TYPES.BOOLEAN, TYPES.OBJECT, TYPES.ARRAY, TYPES.FUNCTION, TYPES.REGEXP, TYPES.Null), comment: 'property type', }) /** Data Type */ diff --git a/src/routes/utils/tree.ts b/src/routes/utils/tree.ts index eafc758..4f92813 100644 --- a/src/routes/utils/tree.ts +++ b/src/routes/utils/tree.ts @@ -108,6 +108,10 @@ export default class Tree { }) } break + case 'Null': + // tslint:disable-next-line: no-null-keyword + result[item.name + rule] = null + break } } } diff --git a/src/scripts/init/bo.ts b/src/scripts/init/bo.ts index b173ddc..d43d17e 100644 --- a/src/scripts/init/bo.ts +++ b/src/scripts/init/bo.ts @@ -2,7 +2,7 @@ import { mock } from 'mockjs' const scopes = ['request', 'response'] const methods = ['GET', 'POST', 'PUT', 'DELETE'] -const types = ['String', 'Number', 'Boolean', 'Object', 'Array', 'Function', 'RegExp'] +const types = ['String', 'Number', 'Boolean', 'Object', 'Array', 'Function', 'RegExp', 'Null'] const values = ['@INT', '@FLOAT', '@TITLE', '@NAME'] let USER_ID = 100000000