package com.org.joint.domain.request.dto;
import com.alibaba.fastjson.JSON;
import com.org.joint.common.enums.UDIEnum;
import com.org.joint.domain.udi.util.Httpsendpost;
import lombok.Data;
import java.io.Serializable;
/**
* @author August 1985381864@qq.com
* @version 1.0
* @description: 获取UDI信息
* @date 2021/12/29 17:25
*/
@Data
public class GetSharingParam implements Serializable {
private static final long serialVersionUID = 1536020347622643888L;
/**
* 接口调用凭据
*/
private String accessToken;
/**
* 请求范围,1 按天请求,2 按月请求,3 全量请求
* @see UDIEnum.GetSharingParamRequestType
*/
private String requestType;
/**
* 当按照天请求数据时,必填,输入参数按照 yyyy-MM-dd,
* 当按照月请求数据时,必填,输入参数按照 yyyy-MM,
* 全量获取时,该参数 为空
*/
private String rangeValue;
/**
* 请求分页数,初始请求时,从 1开始
*/
private String currentPageNumber;
public static final String currentPageNumberStart = "1";
/**
* 获取请求参数
* @return
*/
public String getParam() {
String param = "params=" + JSON.toJSONString(this);
return param;
}
public static void main(String[] args) {
GetSharingParam getSharingParam = new GetSharingParam();
getSharingParam.setCurrentPageNumber("1");
getSharingParam.setRangeValue("20110117");
getSharingParam.setRequestType("1");
getSharingParam.setAccessToken("111");
System.out.println(getSharingParam.getParam());
}
}
version
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
错误日志
Exception in thread "main" java.lang.StackOverflowError at com.alibaba.fastjson.serializer.SerialContext.
(SerialContext.java:10) at com.alibaba.fastjson.serializer.JSONSerializer.setContext(JSONSerializer.java:117) at com.alibaba.fastjson.serializer.JSONSerializer.setContext(JSONSerializer.java:109) at com.alibaba.fastjson.serializer.ASMSerializer_1_GetSharingParam.write(Unknown Source) at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:740) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:678) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:643) at com.org.joint.domain.request.dto.GetSharingParam.getParam(GetSharingParam.java:49) at com.alibaba.fastjson.serializer.ASMSerializer_1_GetSharingParam.write(Unknown Source) at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:740) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:678) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:643) at com.org.joint.domain.request.dto.GetSharingParam.getParam(GetSharingParam.java:49) at com.alibaba.fastjson.serializer.ASMSerializer_1_GetSharingParam.write(Unknown Source) at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:740) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:678) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:643) at com.org.joint.domain.request.dto.GetSharingParam.getParam(GetSharingParam.java:49) at com.alibaba.fastjson.serializer.ASMSerializer_1_GetSharingParam.write(Unknown Source) at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:740) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:678) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:643) at com.org.joint.domain.request.dto.GetSharingParam.getParam(GetSharingParam.java:49) at com.alibaba.fastjson.serializer.ASMSerializer_1_GetSharingParam.write(Unknown Source) at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:740) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:678) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:643) at com.org.joint.domain.request.dto.GetSharingParam.getParam(GetSharingParam.java:49) at com.alibaba.fastjson.serializer.ASMSerializer_1_GetSharingParam.write(Unknown Source) at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:740) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:678) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:643)