wujian
2024-04-17 8c05d8c9715a26e1b7a01db431d1262730d8c408
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;
    }
 
 
}