ObjectJson 对象创建层次结构体

ObjectJson 对象创建层次结构体

Postman 结构体
Body:
{
“D”: -1
“Doption”: {
“downd”: “”
},
“paramMap”: {
“CColumns”: [],
“ran”: [],
“select”: [“3”],
“dateSParams”: {
“tyApe”: “DayInterval”,
“dconfig”: {},
“value”: [60000, 1590161]
}
},
“selectName”: “tbstu”
}

创建ObjectJson对象 进行赋值 生产结构体:

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.Arrays;

@Transactional
@Controller
@RequestMapping("/test1")
public class MainBankTest {
    @Autowired
    private BService service;
    @GetMapping(value = "/getTestQuery")
    @ResponseBody
    public BigDataResp getTestQuery() {
        JSONObject objResutl = new JSONObject();
        objResutl.put("D" , -1);
        JSONObject optionObj = new JSONObject();
        optionObj.put("downd" , "");
        objResutl.put("option" , optionObj);

        JSONObject paramMapObj = new JSONObject();
        ArrayList<T> CColumns = new ArrayList<>();
        ArrayList<T> ran = new ArrayList<>();
        ArrayList<String> select = new ArrayList<>();
        select.add(0,"3");

        ArrayList value = new ArrayList<>(Arrays.asList(10000L, 159000L ));
        JSONObject timeParams = new JSONObject();
        JSONObject config = new JSONObject();
        timeParams.put( "type", "DayInterval");
        timeParams.put( "config", config);
        timeParams.put( "value", value);
        paramMapObj.put("groupColumns"  , groupColumns );
        paramMapObj.put("rank" , ran );
        paramMapObj.put("select" , select );
        paramMapObj.put("timeParams" , timeParams );
        objResutl.put("paramMap" , paramMapObj);
        objResutl.put("selectName" , "tb_stu");
        System.out.println("main queryVO : " + JSON.toJSONString(objResutl));
        BigDataResp resp = bankFeignService.getRun(JSON.toJSONString(objResutl)) ;
        System.out.println("main resp : " + JSON.toJSONString(resp));
        return resp;
    }

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值