Authored by hugufei

调大数据服务

@@ -12,6 +12,15 @@ @@ -12,6 +12,15 @@
12 12
13 <dependencies> 13 <dependencies>
14 <dependency> 14 <dependency>
  15 + <groupId>io.netty</groupId>
  16 + <artifactId>netty-all</artifactId>
  17 + <version>4.1.11.Final</version>
  18 + </dependency>
  19 + <dependency>
  20 + <groupId>com.yoho.core</groupId>
  21 + <artifactId>yoho-core-rest-client-simple</artifactId>
  22 + </dependency>
  23 + <dependency>
15 <groupId>com.yoho.search</groupId> 24 <groupId>com.yoho.search</groupId>
16 <artifactId>search-es</artifactId> 25 <artifactId>search-es</artifactId>
17 </dependency> 26 </dependency>
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 }
@@ -11,7 +11,7 @@ search.multiMatchQuery.type=CROSS_FIELDS @@ -11,7 +11,7 @@ search.multiMatchQuery.type=CROSS_FIELDS
11 search.use.cache=true 11 search.use.cache=true
12 12
13 #zkAddress 13 #zkAddress
14 -zkAddress=192.168.102.216:2181 14 +zkAddress=192.168.102.45:2181
15 15
16 #web.content 16 #web.content
17 web.context=yohosearch 17 web.context=yohosearch