[Feature] 系统内部使用是否这种布尔类型在系统内部都是boolean,但是想导出为integer[0,1], 怎么配置呢?
Jinyun-Liu opened this issue · comments
ac2019 commented
我看枚举已经可以配置值,类型两个转换规则;
枚举值转换
enum.use.custom[groovy:it.isExtend("xyz.jinyun.springboot.common.BaseEnum")]=code
枚举类型转换
json.rule.enum.convert[groovy:it.isExtend("xyz.jinyun.springboot.common.BaseEnum")]=~#code
但是如果是Boolean xx; 这种字段,导出的api也是布尔类型,可以转成0 1吗?我这样配置不生效:
true-1 false-0
json.rule.convert[java.lang.Boolean]=java.lang.Integer
ac2019 commented
json.rule.convert[java.lang.Boolean]=java.lang.Integer 这么配置没问题生效了。