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

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

@@ -521,9 +521,18 @@ public class EigeneaiApi {
 	 */
 	public Collection<Result> getRecommendItemList(int size, String keyword) {
 		String requestUrl = "";
-		requestUrl = apiUrl + "/s003?size="+size+"&cuid=" + cuid + "&st=" + keyword + "&cps=true&cpt=m004";
-
+		
+		// 2021.09.02 공백처리
+		try {
+			keyword = URLEncoder.encode(keyword, "UTF-8");
+			requestUrl = apiUrl + "/s003?size="+size+"&cuid=" + cuid + "&st=" + keyword + "&cps=true&cpt=m004";
+		} catch (UnsupportedEncodingException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
 		Eigeneai eigeneai = this.getEigeneaiInfo(requestUrl);
+		
 		if (eigeneai.getResults() != null && !eigeneai.getResults().isEmpty()) {
 			return eigeneai.getResults();
 		}