|
|
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
|
+import com.style24.persistence.domain.Cart;
|
|
|
import com.style24.persistence.domain.eigene.Eigeneai;
|
|
|
import com.style24.persistence.domain.eigene.Eigeneai.Item;
|
|
|
import com.style24.persistence.domain.eigene.Eigeneai.Result;
|
|
|
@@ -335,7 +336,6 @@ public class EigeneaiApi {
|
|
|
/**
|
|
|
* 연관상품 목록
|
|
|
* 사용되는 화면 영역)
|
|
|
- * 쇼핑백 > 추천상품 (담은 상품이 있는 경우)
|
|
|
* 상품상세 > 함께 본 상품
|
|
|
* @param goodsCd - 상품코드
|
|
|
* @param size - 결과에 포함할 상품수
|
|
|
@@ -354,6 +354,39 @@ public class EigeneaiApi {
|
|
|
return new ArrayList<Result>();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 연관상품 목록
|
|
|
+ * 사용되는 화면 영역)
|
|
|
+ * 쇼핑백 > 추천상품 (담은 상품이 있는 경우)
|
|
|
+ * @param cartList - 장바구니목록
|
|
|
+ * @param size - 결과에 포함할 상품수
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 5. 14
|
|
|
+ */
|
|
|
+ public Collection<Result> getRelatedGoodsList(Collection<Cart> cartList, int size) {
|
|
|
+ if (cartList != null && !cartList.isEmpty()) {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ int idx = 0;
|
|
|
+
|
|
|
+ for (Cart cart : cartList) {
|
|
|
+ if (idx++ > 0) {
|
|
|
+ sb.append(",");
|
|
|
+ }
|
|
|
+ sb.append(cart.getGoodsCd());
|
|
|
+ }
|
|
|
+
|
|
|
+ String requestUrl = apiUrl + "/a037?cuid=" + cuid + "&size=" + size + "&iids=" + sb.toString() + "&cps=true&cpt=m001";
|
|
|
+
|
|
|
+ Eigeneai eigeneai = this.getEigeneaiInfo(requestUrl);
|
|
|
+ if (eigeneai.getResults() != null && !eigeneai.getResults().isEmpty()) {
|
|
|
+ return eigeneai.getResults();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return new ArrayList<Result>();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 브랜드 연관상품 목록
|
|
|
* 사용되는 화면 영역)
|
|
|
@@ -366,7 +399,7 @@ public class EigeneaiApi {
|
|
|
* @since 2021. 5. 14
|
|
|
*/
|
|
|
public Collection<Result> getBrandRelatedGoodsList(int size, String goodsCd, Integer brandGroupNo) {
|
|
|
- String requestUrl = apiUrl + "/a038?cuid=" + cuid + "&size=" + size + "&iids=" + goodsCd + "&cps=true&cpt=c001&cpcids=" + brandGroupNo;
|
|
|
+ String requestUrl = apiUrl + "/a038?cuid=" + cuid + "&size=" + size + "&iids=" + goodsCd + "&cps=true&cpt=b004&bids=" + brandGroupNo;
|
|
|
|
|
|
Eigeneai eigeneai = this.getEigeneaiInfo(requestUrl);
|
|
|
if (eigeneai.getResults() != null && !eigeneai.getResults().isEmpty()) {
|