1
|
package com.yoho.search.recall.scene.beans.persional;
|
1
|
package com.yoho.search.recall.scene.beans.persional;
|
2
|
|
2
|
|
|
|
3
|
+import com.alibaba.fastjson.JSON;
|
|
|
4
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
5
|
+import com.yoho.core.rest.client.ServiceCaller;
|
3
|
import com.yoho.search.core.personalized.models.SortPriceArea;
|
6
|
import com.yoho.search.core.personalized.models.SortPriceArea;
|
|
|
7
|
+import com.yoho.search.core.personalized.models.UserPersonalFactorReq;
|
4
|
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
|
8
|
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
|
5
|
import org.slf4j.Logger;
|
9
|
import org.slf4j.Logger;
|
6
|
import org.slf4j.LoggerFactory;
|
10
|
import org.slf4j.LoggerFactory;
|
|
|
11
|
+import org.springframework.beans.factory.annotation.Autowired;
|
7
|
import org.springframework.stereotype.Component;
|
12
|
import org.springframework.stereotype.Component;
|
8
|
|
13
|
|
9
|
import java.util.ArrayList;
|
14
|
import java.util.ArrayList;
|
|
@@ -14,12 +19,12 @@ class UserPersionalFactorComponent { |
|
@@ -14,12 +19,12 @@ class UserPersionalFactorComponent { |
14
|
|
19
|
|
15
|
private static final Logger logger = LoggerFactory.getLogger(UserPersionalFactorComponent.class);
|
20
|
private static final Logger logger = LoggerFactory.getLogger(UserPersionalFactorComponent.class);
|
16
|
|
21
|
|
17
|
- //@Autowired
|
|
|
18
|
- // private ServiceCaller serviceCaller;
|
22
|
+ @Autowired
|
|
|
23
|
+ private ServiceCaller serviceCaller;
|
19
|
|
24
|
|
20
|
//serviceCaller.asyncCall("message.publishIosUser", iosTokenBO, Integer.class);
|
25
|
//serviceCaller.asyncCall("message.publishIosUser", iosTokenBO, Integer.class);
|
21
|
|
26
|
|
22
|
- private static final String SERVICE_NAME = "bigdata.UserPersionalFactor";
|
27
|
+ private static final String SERVICE_NAME = "bigdata.userPersionalFactorRsp";
|
23
|
private static final int timeOut = 100;
|
28
|
private static final int timeOut = 100;
|
24
|
|
29
|
|
25
|
/**
|
30
|
/**
|
|
@@ -49,13 +54,14 @@ class UserPersionalFactorComponent { |
|
@@ -49,13 +54,14 @@ class UserPersionalFactorComponent { |
49
|
}
|
54
|
}
|
50
|
|
55
|
|
51
|
private UserPersonalFactorRsp queryUserPersionalFactorRsp(int uid, String udid){
|
56
|
private UserPersonalFactorRsp queryUserPersionalFactorRsp(int uid, String udid){
|
52
|
-// try {
|
|
|
53
|
-// UserPersionalFactorReq userPersionalFactorReq = new UserPersionalFactorReq(uid,udid);
|
|
|
54
|
-// return serviceCaller.call(SERVICE_NAME,userPersionalFactorReq,UserPersionalFactorRsp.class,timeOut);
|
|
|
55
|
-// }catch (Exception e){
|
|
|
56
|
-// logger.error(e.getMessage(),e);
|
|
|
57
|
-// return null;
|
|
|
58
|
-// }
|
57
|
+ try {
|
|
|
58
|
+ UserPersonalFactorReq userPersionalFactorReq = new UserPersonalFactorReq(uid,udid);
|
|
|
59
|
+ JSONObject result = serviceCaller.call(SERVICE_NAME,userPersionalFactorReq,JSONObject.class,timeOut);
|
|
|
60
|
+ JSONObject userPersonalFactorRspJSon = result.getJSONObject("data");
|
|
|
61
|
+ return JSON.toJavaObject(userPersonalFactorRspJSon,UserPersonalFactorRsp.class);
|
|
|
62
|
+ }catch (Exception e){
|
|
|
63
|
+ logger.error(e.getMessage(),e);
|
59
|
return null;
|
64
|
return null;
|
60
|
}
|
65
|
}
|
|
|
66
|
+ }
|
61
|
} |
67
|
} |