bin2107 4 vuotta sitten
vanhempi
commit
3f57b4da43

+ 21 - 0
src/main/java/com/style24/front/biz/thirdparty/EigeneaiApi.java

@@ -540,4 +540,25 @@ public class EigeneaiApi {
 		return new ArrayList<Result>();
 	}
 
+	/**
+	 * 당신을 위한 제안
+	 * 사용되는 화면 영역)
+	 * 		메인 > 당신을 위한 제안
+	 * @param goodsCd - 상품코드
+	 * @param size - 결과에 포함할 상품수
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 9. 23
+	 */
+	public Collection<Result> getRecommendForYouList(String goodsCd, int size) {
+		String requestUrl = apiUrl + "/a037?cuid=" + cuid + "&size=" + size + "&iids=" + goodsCd + "&cps=true&cpt=m001";
+
+		Eigeneai eigeneai = this.getEigeneaiInfo(requestUrl);
+		if (eigeneai.getResults() != null && !eigeneai.getResults().isEmpty()) {
+			return eigeneai.getResults();
+		}
+
+		return new ArrayList<Result>();
+	}
+
 }

+ 7 - 4
src/main/webapp/WEB-INF/views/web/display/SearchGoodsListFormWeb.html

@@ -112,8 +112,8 @@
 							</div>
 						</div>
 						<!-- //통합 상품 검색결과 없을 시 노출 -->
-						<!-- 추천상품 노출 -->
-						<div class="sch_recommend" style="display:none;">
+						<!-- 추천상품 노출 style="display:none;"-->
+						<div class="sch_recommend">
 							<h3>이런 상품은 어떤가요?</h3>
 							<div class="itemsGrp" id="recommendItemArea">
 								<div class="item_prod">
@@ -536,7 +536,7 @@
 				$('#noFilterData').hide();
 				$('#endPage').hide();
 				$('#goodsNodata').hide();
-				$('.sch_recommend').hide();
+				// $('.sch_recommend').show();
 				$('#goodsKeyword').text('');
 				$('.cont_body .lnb').show();
 				//$('.cont_body .cont').show();
@@ -551,6 +551,8 @@
 				listIdx++;
 				fnImgOnoff();
 			}else{
+				// 추천상품 hide
+				// $('.sch_recommend').hide();
 				if(listIdx > 1){ // 데이터가 1건 이상
 					if(totalCnt > Number($("#searchGoodsForm").find("input[name=pageSize]").val())){
 						if($("#searchGoodsForm input[name=pageNo]").val()==1){
@@ -577,7 +579,6 @@
 					$('.cont_body .lnb').hide();
 					//$('.cont_body .cont').hide();
 					$("#filterArea").hide();
-					$('.sch_recommend').show();
 					// 검색어 연관 상품 추천
 					fnRecommendItemList([[${params.keyword}]]);
 				}
@@ -1181,6 +1182,8 @@
 			//listIdx = 1;
 			$('#endPage').hide();
 			$('#noFilterData').hide();
+			// 추천상품 hide
+			$('.sch_recommend').hide();
 		}
 
 	</script>