import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
mvc返回json时转化
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
@JSONField(serializeUsing = ToStringSerializer.class)
private Long id;
JSONArray array = JSONArray.parseArray(JSON.toJSONString(casePcapsRes));文章来源:https://www.uudwc.com/A/Ev06m/
用json工具类时转化文章来源地址https://www.uudwc.com/A/Ev06m/