In SpringBoot, the front-end passes parameters 0,1, and the back-end can be automatically parsed into a boolean type, but when the back-end returns the front-end boolean type, it cannot be automatically converted to 0,1, so we need to customize the serialization configuration, and the boolean type converted to 0,1
1. Type correspondence
- The boolean type has
false,true
- corresponding int type
0,1
2. Serialization configuration
import com.fasterxml.jackson.core.JsonGenera