首页 > 其他 > 详细

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

时间:2019-10-12 13:19:22      阅读:87      评论:0      收藏:0      [点我收藏+]

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

 

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

原文:https://www.cnblogs.com/gxlaqj/p/11660867.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!