44 lines
1.6 KiB
Java
44 lines
1.6 KiB
Java
package com.example.sso.controller;
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.example.sso.util.RongLianQiMo;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@Slf4j
|
|
@RestController
|
|
public class SongHaoShenQingTongHua {
|
|
@PostMapping("/shenqingtonghua")
|
|
public void shenqingtonghua(@RequestBody JSONObject datas) throws JsonProcessingException {
|
|
log.info("shenqingtonghua " + datas.toJSONString());
|
|
JSONObject data = datas.getJSONObject("data");
|
|
String taskid = data.getString("taskid");
|
|
String phone = data.getString("phone");
|
|
String name = data.getString("name");
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("taskid",taskid);
|
|
JSONArray vars = new JSONArray();
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
jsonObject1.put("phone",phone);
|
|
jsonObject1.put("name",name);
|
|
String s = mapper.writeValueAsString(jsonObject1);
|
|
vars.add(s);
|
|
|
|
jsonObject.put("vars",vars);
|
|
jsonObject.put("count",1);
|
|
String jsonString = jsonObject.toJSONString();
|
|
System.out.println("我是参数 " +jsonString );
|
|
String songhao = RongLianQiMo.songhao(jsonString);
|
|
System.out.println(songhao);
|
|
|
|
|
|
}
|
|
}
|