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