java返回给前端不隐藏部分字段


@JsonIgnore
在对应的字段上添加这个注解

在get方法上面添加,如果是 lombok.Data,直接在属性上面添加
@Data
public class test {

    /**
     *  字段
     */
    @JsonIgnore
    private String testColmun;
}

猜你喜欢

转载自www.cnblogs.com/LMDclg/p/13162069.html