为返回给界面的bean中的字段添加@JsonInclude(value=Include.NON_NULL)注解,当值为null时隐藏字段
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
package com.nis.domain.restful;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
public class NtcSrcipDomesticReport extends NtcReportEntity<NtcSrcipDomesticReport>{
|
||||
|
||||
private static final long serialVersionUID = -2146157609572355782L;
|
||||
@JsonInclude(value=Include.NON_NULL)
|
||||
@ApiModelProperty(value="所属省", required=true)
|
||||
protected String srcProvince;
|
||||
@JsonInclude(value=Include.NON_NULL)
|
||||
@ApiModelProperty(value="所属市", required=true)
|
||||
protected String srcCity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user