其他分享
首页 > 其他分享> > 若是前台接收的数据为null的不进行传递

若是前台接收的数据为null的不进行传递

作者:互联网

1.在实体类上添加注解

@JsonInclude(JsonInclude.Include.NON_NULL)

 

2.在yml中进行配置全局

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    username: root
    password: 123456
    url: jdbc:mysql://192.168.30.113/sell?characterEncoding=utf-8&useSSL=false
  jpa:
    show-sql: true
  jackson:
    default-property-inclusion: non_null
  redis:
    host: 192.168.30.113
    port: 6379
server:
  context-path: /sell

 

标签:sell,接收,30.113,192.168,jdbc,前台,mysql,null,JsonInclude
来源: https://www.cnblogs.com/gxlaqj/p/11660867.html