|
|
package com.yohoufo.inboxclient.sdk;
|
|
|
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.caller.UfoServiceCaller;
|
|
|
import com.yohoufo.inboxclient.common.UrlConstant;
|
|
|
import com.yohoufo.inboxclient.model.InBoxResponse;
|
|
|
import com.yohoufo.inboxclient.model.InboxReqVO;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
/**
|
|
|
* Created by shengguo.cai on 2018/9/19.
|
...
|
...
|
@@ -14,14 +15,16 @@ import org.springframework.stereotype.Service; |
|
|
@Service
|
|
|
public class InBoxSDK {
|
|
|
@Autowired
|
|
|
private UfoServiceCaller serviceCaller;
|
|
|
private RestTemplate restTemplate;
|
|
|
@Autowired
|
|
|
private UrlConstant urlConstant;
|
|
|
|
|
|
private final Logger log = LoggerFactory.getLogger(InBoxSDK.class);
|
|
|
|
|
|
public ApiResponse addInbox(InboxReqVO reqVO){
|
|
|
public InBoxResponse addInbox(InboxReqVO reqVO){
|
|
|
log.info("addInbox with param is {}", reqVO);
|
|
|
ApiResponse result = serviceCaller.call("ufo.users.addInbox",ApiResponse.class,reqVO.getUid(),
|
|
|
reqVO.getType(),reqVO.getBusinessType(),reqVO.getParams());
|
|
|
InBoxResponse result = restTemplate.getForObject(urlConstant.getInboxAddUrl()+"&uid={1}&type={2}&businessType={3}¶ms={4}",InBoxResponse.class,
|
|
|
reqVO.getUid(),reqVO.getType(),reqVO.getBusinessType(),reqVO.getParams());
|
|
|
log.info("addInbox call result is {}",result);
|
|
|
return result;
|
|
|
}
|
...
|
...
|
|