1、使用注解
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
private List<CategoryEntity> children;
2、在yum文件里面配置
一个个注解是很麻烦的,我们可以在yml文件里面进行配置
spring:
jackson:
default-property-inclusion: NON_EMPTY
微信扫一扫
1、使用注解
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
private List<CategoryEntity> children;
2、在yum文件里面配置
一个个注解是很麻烦的,我们可以在yml文件里面进行配置
spring:
jackson:
default-property-inclusion: NON_EMPTY
相关推荐