Class OutboundCommandHandler<C>
java.lang.Object
com.sankcrm.erp.apisix.application.command.outbound.OutboundCommandHandler<C>
- All Implemented Interfaces:
com.sankcrm.erp.bus.CommandHandler<String,OutboundCommand<C>>
@Component("apisixOutboundCommandHandler")
public class OutboundCommandHandler<C>
extends Object
implements com.sankcrm.erp.bus.CommandHandler<String,OutboundCommand<C>>
发送请求.
- Since:
- 2.1.0
- Author:
- zhsxin
- create time:
- 2023/4/4 下午3:29
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandle(OutboundCommand<C> command) protected Stringread(org.springframework.http.client.ClientHttpResponse message) 读响应报文protected org.springframework.web.client.RequestCallbackrequestCallback(C command, com.sankcrm.erp.common.sensitive.SecretKey token) protected org.springframework.web.client.ResponseExtractor<String> protected org.springframework.web.client.RestTemplaterest()HTTP请求工具
-
Constructor Details
-
OutboundCommandHandler
public OutboundCommandHandler()
-
-
Method Details
-
handle
public String handle(OutboundCommand<C> command) throws com.sankcrm.erp.common.exception.CoreException - Specified by:
handlein interfacecom.sankcrm.erp.bus.CommandHandler<String,OutboundCommand<C>> - Throws:
com.sankcrm.erp.common.exception.CoreException
-
requestCallback
protected org.springframework.web.client.RequestCallback requestCallback(C command, com.sankcrm.erp.common.sensitive.SecretKey token) -
responseExtractor
-
read
protected String read(org.springframework.http.client.ClientHttpResponse message) throws IOException 读响应报文- Parameters:
message- 响应实体- Returns:
- 响应报文
- Throws:
IOException
-
rest
protected org.springframework.web.client.RestTemplate rest()HTTP请求工具- Returns:
- RestTemplate
-