为返回给界面的bean中的字段添加@JsonInclude(value=Include.NON_NULL)注解,当值为null时隐藏字段

This commit is contained in:
RenKaiGe-Office
2018-07-30 14:01:07 +08:00
parent 927e8d1926
commit d37ce642db
8 changed files with 54 additions and 25 deletions

View File

@@ -1,30 +1,33 @@
package com.nis.domain.restful;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.wordnik.swagger.annotations.ApiModelProperty;
public class NtcLwhhReport extends NtcReportEntity<NtcLwhhReport>{
public class NtcLwhhReport extends NtcReportEntity<NtcLwhhReport> {
private static final long serialVersionUID = -5980925900825684234L;
@JsonInclude(value = Include.NON_NULL)
@ApiModelProperty(value = "性质", required = true)
protected Integer lwhh;
@ApiModelProperty(value="性质", required=true)
protected Integer lwhh ;
protected String searchLwhh;
/**
* @param lwhh the lwhh to set
*/
public void setLwhh(Integer lwhh) {
this.lwhh = lwhh;
}
/**
* @return the lwhh
*/
public Integer getLwhh() {
return lwhh;
}
/**
* @return the searchLwhh
*/
@@ -32,7 +35,7 @@ public class NtcLwhhReport extends NtcReportEntity<NtcLwhhReport>{
public String getSearchLwhh() {
return searchLwhh;
}
/**
* @param searchLwhh the searchLwhh to set
*/