|
|
package com.yoho.search.recall.scene.beans.persional;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.search.core.personalized.models.SortPriceArea;
|
|
|
import com.yoho.search.core.personalized.models.UserPersonalFactorReq;
|
|
|
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
...
|
...
|
@@ -14,12 +19,12 @@ class UserPersionalFactorComponent { |
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(UserPersionalFactorComponent.class);
|
|
|
|
|
|
//@Autowired
|
|
|
// private ServiceCaller serviceCaller;
|
|
|
@Autowired
|
|
|
private ServiceCaller serviceCaller;
|
|
|
|
|
|
//serviceCaller.asyncCall("message.publishIosUser", iosTokenBO, Integer.class);
|
|
|
|
|
|
private static final String SERVICE_NAME = "bigdata.UserPersionalFactor";
|
|
|
private static final String SERVICE_NAME = "bigdata.userPersionalFactorRsp";
|
|
|
private static final int timeOut = 100;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -49,13 +54,14 @@ class UserPersionalFactorComponent { |
|
|
}
|
|
|
|
|
|
private UserPersonalFactorRsp queryUserPersionalFactorRsp(int uid, String udid){
|
|
|
// try {
|
|
|
// UserPersionalFactorReq userPersionalFactorReq = new UserPersionalFactorReq(uid,udid);
|
|
|
// return serviceCaller.call(SERVICE_NAME,userPersionalFactorReq,UserPersionalFactorRsp.class,timeOut);
|
|
|
// }catch (Exception e){
|
|
|
// logger.error(e.getMessage(),e);
|
|
|
// return null;
|
|
|
// }
|
|
|
try {
|
|
|
UserPersonalFactorReq userPersionalFactorReq = new UserPersonalFactorReq(uid,udid);
|
|
|
JSONObject result = serviceCaller.call(SERVICE_NAME,userPersionalFactorReq,JSONObject.class,timeOut);
|
|
|
JSONObject userPersonalFactorRspJSon = result.getJSONObject("data");
|
|
|
return JSON.toJavaObject(userPersonalFactorRspJSon,UserPersonalFactorRsp.class);
|
|
|
}catch (Exception e){
|
|
|
logger.error(e.getMessage(),e);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
} |
...
|
...
|
|