cl
2024-07-04 5b544fc8d6029a71669b3992c5cfea9a044aaf3f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.jcdm.main.demo.controller;
 
 
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONPObject;
import com.jcdm.main.demo.vo.FeedBackDataVO;
import com.jcdm.main.demo.vo.FeedBackVO;
import org.springframework.web.bind.annotation.*;
 
@RestController
@RequestMapping("/sendDemo")
public class SendDemo {
 
    @PostMapping("/push")
    public JSONObject push(@RequestBody JSONObject param){
 
        FeedBackVO vo = new FeedBackVO();
        FeedBackDataVO dataVO = new FeedBackDataVO();
        dataVO.setProductNum("1111");
        dataVO.setResultCode("S");
        dataVO.setResultText("采集完成");
        vo.setCode("success");
        vo.setMessage("API调用成功");
        vo.setData(dataVO);
        JSONObject from = JSONObject.from(vo);
 
        String jsonString = JSONObject.toJSONString(vo);
        System.out.println(jsonString);
        return from;
    }
 
 
}