1. 定义Http param消息体
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class NormalApprovedReq {
private String id;
private JSonObject ehrNormalResultEntity;
// JSonObject 格式,实例化时需要用JSONObject.parseObject("")转义
}
2. HttpClient
public JSonObject ehrNormalApply(String param, String token) throws Exception {
String url = IConst.ip + EhrIConst.EHR_Normal_APPLY; // url
// String response = HttpClient.sendPostDataByJson(url, param,token); //发送Post请求
String response = HttpClient.sendGetDataAndToken(url,param,token); //发送get请求
JSonObject result = JSONObject.parseObject(response);
return result;
}
3. 构建实体HttpClient并发送,获取返回结果
NormalApprovedReq normalApprovedReq=NormalApprovedReq.builder()
.id(normalId)
.comment("自动化测试 - 驳回")
.approveStatus(6)
.build();
String param = JSON.toJSonString(normalApprovedReq);
JSonObject res = ehrNormalService.ehrNormalApproved(param,ApproverToken
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)