添加远程调用接口
parent
94a8a89289
commit
8a51795f94
@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"method": "WS_RECORD_SUBMIT",
|
||||
"urls": ["http://127.0.0.1:9312/message/receive/wsRecordSubmit/do22"],
|
||||
"urls": ["http://127.0.0.1:9313/message/receive/wsRecordSubmit/do"],
|
||||
"errorResult": "<Response><RetInfo><RetCode>1</RetCode><RetCon>${{xpath:/Request/Msg/INHOSP_NO}}系统错误!</RetCon></RetInfo></Response>",
|
||||
"messageDataType": 1
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
package com.docus.server.message.api;
|
||||
|
||||
import com.docus.infrastructure.web.api.CommonResult;
|
||||
import com.docus.server.message.api.dto.CompensateTaskDTO;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
public interface CollectTaskService {
|
||||
|
||||
/**
|
||||
*无视图采集,采集任务补偿
|
||||
* @param dto 参数
|
||||
* @return 结果
|
||||
*/
|
||||
CommonResult<String> compensateTask(CompensateTaskDTO dto);
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package com.docus.server.message.api.impl;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.docus.core.util.Func;
|
||||
import com.docus.infrastructure.web.api.CommonResult;
|
||||
import com.docus.server.message.api.CollectTaskService;
|
||||
import com.docus.server.message.api.dto.CompensateTaskDTO;
|
||||
import com.docus.server.message.config.UrlConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@Service
|
||||
public class CollectTaskServiceImpl implements CollectTaskService {
|
||||
|
||||
private UrlConfig urlConfig;
|
||||
|
||||
@Autowired
|
||||
public void setUrlConfig(UrlConfig urlConfig) {
|
||||
this.urlConfig = urlConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> compensateTask(CompensateTaskDTO dto) {
|
||||
String response = HttpUtil.post(urlConfig.getCompensateTaskUrl(), Func.toJson(dto));
|
||||
CommonResult commonResult = Func.readJson(response, CommonResult.class);
|
||||
Object data = commonResult.getData();
|
||||
CommonResult<String> result = new CommonResult<>();
|
||||
result.setCode(commonResult.getCode());
|
||||
result.setMsgCode(commonResult.getMsgCode());
|
||||
result.setMsg(commonResult.getMsg());
|
||||
result.setData(data==null?null:String.valueOf(data));
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.docus.server.message.feign.service;
|
||||
|
||||
import com.docus.infrastructure.web.api.CommonResult;
|
||||
import com.docus.server.message.feign.dto.CompensateTasRequest;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@FeignClient(url = "${docus.url.compensate-task-url}",name = "view-collect-task")
|
||||
public interface CollectTaskService {
|
||||
|
||||
/**
|
||||
*无视图采集,采集任务补偿
|
||||
* @param dto 参数
|
||||
* @return 结果
|
||||
*/
|
||||
@RequestMapping(value = "api/NoViewCollect/compensateTask",method = RequestMethod.POST)
|
||||
CommonResult<String> compensateTask(@RequestBody CompensateTasRequest dto);
|
||||
}
|
Loading…
Reference in New Issue