Demo.java
780 Bytes
package cn.fw.valhalla;
import cn.fw.valhalla.sdk.param.CustomerQueryReq;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
/**
* @author : kurisu
* @version :
* @className : Demo
* @description :
* @date : 2023-05-04 09:13
*/
public class Demo {
@Test
public void phoneTest() throws JsonProcessingException {
CustomerQueryReq req = new CustomerQueryReq();
ObjectMapper objectMapper = new ObjectMapper();
String jsonString = JSONObject.toJSONString(req);
System.out.println(jsonString);
jsonString = objectMapper.writeValueAsString(req);
System.out.println(jsonString);
}
}