Authored by hugufei

service添加serviceCaller的依赖

@@ -12,6 +12,10 @@ @@ -12,6 +12,10 @@
12 12
13 <dependencies> 13 <dependencies>
14 <dependency> 14 <dependency>
  15 + <groupId>com.yoho.core</groupId>
  16 + <artifactId>yoho-core-rest-client-simple</artifactId>
  17 + </dependency>
  18 + <dependency>
15 <groupId>com.yoho.search</groupId> 19 <groupId>com.yoho.search</groupId>
16 <artifactId>search-es</artifactId> 20 <artifactId>search-es</artifactId>
17 </dependency> 21 </dependency>
1 package com.yoho.search.recall.scene.beans.persional; 1 package com.yoho.search.recall.scene.beans.persional;
2 2
  3 +import com.yoho.core.rest.client.ServiceCaller;
  4 +import com.yoho.search.core.personalized.models.UserPersionalFactorReq;
  5 +import com.yoho.search.core.personalized.models.UserPersionalFactorRsp;
3 import com.yoho.search.recall.scene.models.PersionalFactor; 6 import com.yoho.search.recall.scene.models.PersionalFactor;
  7 +import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.stereotype.Component; 8 import org.springframework.stereotype.Component;
5 9
6 import java.util.ArrayList; 10 import java.util.ArrayList;
@@ -9,6 +13,14 @@ import java.util.List; @@ -9,6 +13,14 @@ import java.util.List;
9 @Component 13 @Component
10 class UserPersionalFactorComponent { 14 class UserPersionalFactorComponent {
11 15
  16 + @Autowired
  17 + private ServiceCaller serviceCaller;
  18 +
  19 + //serviceCaller.asyncCall("message.publishIosUser", iosTokenBO, Integer.class);
  20 +
  21 + private static final String SERVICE_NAME = "bigdata.UserPersionalFactor";
  22 + private static final int timeOut = 100;
  23 +
12 /** 24 /**
13 * 获取用户的个性化因子 25 * 获取用户的个性化因子
14 * 26 *
@@ -29,5 +41,8 @@ class UserPersionalFactorComponent { @@ -29,5 +41,8 @@ class UserPersionalFactorComponent {
29 return new PersionalFactor(brandIds, sortPriceArea,factor); 41 return new PersionalFactor(brandIds, sortPriceArea,factor);
30 } 42 }
31 43
  44 + private UserPersionalFactorRsp queryUserPersionalFactorRsp( UserPersionalFactorReq userPersionalFactorReq){
  45 + return serviceCaller.call(SERVICE_NAME,userPersionalFactorReq,UserPersionalFactorRsp.class,timeOut);
  46 + }
32 47
33 } 48 }