Просмотр исходного кода

실시간 많이 조회되고 있는 상품 목록 로직 수정

gagamel 4 лет назад
Родитель
Сommit
e2e3e72815
1 измененных файлов с 11 добавлено и 4 удалено
  1. 11 4
      src/main/java/com/style24/front/biz/thirdparty/EigeneaiApi.java

+ 11 - 4
src/main/java/com/style24/front/biz/thirdparty/EigeneaiApi.java

@@ -30,7 +30,8 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class EigeneaiApi {
 
-	private String apiUrl = "http://api.eigene.io/rec";
+	private String apiUrl = "https://api.eigene.io/rec";
+	private String rtsApiUrl = "https://rts-api.eigene.io/api";
 	private String cuid = "1252aed4-78dc-46e8-b784-94ac42e86dd4";
 
 	@Autowired
@@ -166,9 +167,15 @@ public class EigeneaiApi {
 	 * @author gagamel
 	 * @since 2021. 5. 14
 	 */
-	public Eigeneai getRealtimeGoodsList(int size) {
-		String requestUrl = apiUrl + "/stream?cuid=" + cuid + "&size=" + size; //iids
-		return this.getRecommendationGoodsList(requestUrl);
+	public Collection<Result> getRealtimeGoodsList(int size) {
+		String requestUrl = rtsApiUrl + "/stream?cuid=" + cuid + "&size=" + size + "&type=view";
+
+		Eigeneai eigeneai = this.getRecommendationGoodsList(requestUrl);
+		if (eigeneai.getResults() != null && !eigeneai.getResults().isEmpty()) {
+			return eigeneai.getResults();
+		}
+
+		return new ArrayList<Result>();
 	}
 
 	/**