在 SpringBoot 中,前端传参数 0,1,后端可自动解析为 boolean 类型,但后端返回前端 boolean 类型时,却无法自动转换为 0,1,所以我们需要自定义序列化配置,将 boolean 类型转化为 0,1 1、类型对应 boolean 类型有 false,true 对应的 int 类型 0,1 2、序列化配置 import com.fasterxml.jackson.core.JsonGenera