在前后端交互,遵循JSON驼峰命名规范,不符合规范是传不过来的
解决办法
1.在application.yml下配置
spring:
jackson:
property-naming-strategy:
详细看以下
策略 例子 备注
LOWER_CAMEL_CASE userName 默认策略
KEBAB_CASE user-name
LOWER_CASE username
SNAKE_CASE user_name
UPPER_CAMEL_CASE UserName
2.在实体类中对应属性上添加
@JsonProperty(value = "前端传过的key")