|
|
package com.yohoufo.user.service.risk;
|
|
|
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.service.model.uic.request.VerifiedGraphicReqBO;
|
|
|
import com.yoho.uic.client.SDK.yoho.GraphicVerifiedSDK;
|
|
|
import com.yoho.uic.client.model.UicResponse;
|
|
|
import com.yohoufo.common.interceptor.RemoteIPInterceptor;
|
|
|
import com.yohoufo.user.helper.RestTemplateHelper;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.context.ApplicationEventPublisherAware;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
...
|
...
|
@@ -23,16 +23,13 @@ public class GraphVerifyService implements ApplicationEventPublisherAware { |
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(GraphVerifyService.class);
|
|
|
|
|
|
@Resource
|
|
|
ServiceCaller serviceCaller;
|
|
|
|
|
|
@Autowired
|
|
|
GraphicVerifiedSDK graphicVerifiedSDK;
|
|
|
|
|
|
private ApplicationEventPublisher publisher;
|
|
|
|
|
|
@Autowired
|
|
|
private RestTemplateHelper restTemplateHelper;
|
|
|
|
|
|
|
|
|
@Value("${uic.service.url}")
|
|
|
private String uicServiceUrl;
|
|
|
|
|
|
/**
|
|
|
* 验证图形验证码
|
...
|
...
|
@@ -47,8 +44,10 @@ public class GraphVerifyService implements ApplicationEventPublisherAware { |
|
|
|
|
|
String ip = RemoteIPInterceptor.getRemoteIP();
|
|
|
|
|
|
//ip="172.16.6.90";
|
|
|
|
|
|
logger.info("checkAndVerifyGrap, clientType is {}, appVersion is {}, fromPage is {}, udid is {}, degrees is {}, ip is {}, appType is {}", clientType, appVersion, fromPage, udid, degrees, ip, appType);
|
|
|
com.yoho.uic.client.model.request.VerifiedGraphicReqBO reqBO = new com.yoho.uic.client.model.request.VerifiedGraphicReqBO();
|
|
|
VerifiedGraphicReqBO reqBO = new VerifiedGraphicReqBO();
|
|
|
reqBO.setUdid(udid);
|
|
|
reqBO.setAppType(appType);
|
|
|
reqBO.setFromPage(fromPage);
|
...
|
...
|
@@ -58,8 +57,7 @@ public class GraphVerifyService implements ApplicationEventPublisherAware { |
|
|
reqBO.setIp(ip);
|
|
|
reqBO.setBusinessLine("ufo");
|
|
|
|
|
|
graphicVerifiedSDK.checkAndVerifyGrap(reqBO);
|
|
|
|
|
|
restTemplateHelper.postByJson(uicServiceUrl+"/VerifiedGraphicRest/checkAndVerifyGrap",reqBO,Object.class);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -75,6 +73,8 @@ public class GraphVerifyService implements ApplicationEventPublisherAware { |
|
|
|
|
|
String ip = RemoteIPInterceptor.getRemoteIP();
|
|
|
|
|
|
//ip="172.16.6.90";
|
|
|
|
|
|
logger.info("triggerUfoGraphVerifySwitch, clientType is {}, appVersion is {}, fromPage is {}, udid is {}, degrees is {}, ip is {}, appType is {}", clientType, appVersion, fromPage, udid, degrees, ip, appType);
|
|
|
VerifiedGraphicReqBO reqBO = new VerifiedGraphicReqBO();
|
|
|
reqBO.setUdid(udid);
|
...
|
...
|
@@ -84,9 +84,9 @@ public class GraphVerifyService implements ApplicationEventPublisherAware { |
|
|
reqBO.setApp_version(appVersion);
|
|
|
reqBO.setClient_type(clientType);
|
|
|
reqBO.setIp(ip);
|
|
|
reqBO.setBusinessLine("ufo");
|
|
|
|
|
|
serviceCaller.call("uic.triggerUfoGraphVerifySwitch", reqBO, UicResponse.class);
|
|
|
|
|
|
restTemplateHelper.postByJson(uicServiceUrl+"/VerifiedGraphicRest/triggerUfoGraphVerifySwitch",reqBO,Object.class);
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
|