|
|
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
import org.springframework.mobile.device.Device;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -63,7 +64,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
/**
|
|
|
* 전시 Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author gagamel
|
|
|
* @since 2020. 12. 29
|
|
|
*/
|
|
|
@@ -102,6 +103,9 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
@Autowired
|
|
|
private EigeneaiApi eigeneaiApi;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private Environment env;
|
|
|
+
|
|
|
/**
|
|
|
* PC보기. 모바일에서 <PC> 형태로 볼 때
|
|
|
* @return
|
|
|
@@ -258,12 +262,12 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
@GetMapping("/mall/main/form3")
|
|
|
public ModelAndView mallMain3(Device device, @RequestParam HashMap<String, String> paramMap) {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
-
|
|
|
+
|
|
|
mav.setViewName(super.getDeviceViewName("display/MallMainForm3"));
|
|
|
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 몰 메인 테스트 폼
|
|
|
* @return
|
|
|
@@ -386,8 +390,8 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* GNB탭 > 브랜드그룹 목록
|
|
|
* @param contents - 컨텐츠 정보
|
|
|
@@ -902,14 +906,26 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
}
|
|
|
|
|
|
Collection<SearchEngine> dataList = new ArrayList<SearchEngine>();
|
|
|
-
|
|
|
+
|
|
|
log.info("params.getSortingType() ::: {}", params.getSortingType());
|
|
|
|
|
|
- GoodsListResponse response = diquest.getGoodsList(params);
|
|
|
- pageable.setTotalCount(response.getTotalCount());
|
|
|
- dataList = response.getResponse();
|
|
|
- result.set("paging", pageable);
|
|
|
- result.set("dataList", dataList);
|
|
|
+// GoodsListResponse response = diquest.getGoodsList(params);
|
|
|
+// pageable.setTotalCount(response.getTotalCount());
|
|
|
+// dataList = response.getResponse();
|
|
|
+// result.set("paging", pageable);
|
|
|
+// result.set("dataList", dataList);
|
|
|
+
|
|
|
+ String profiles = env.getProperty("spring.profiles.active").toLowerCase();
|
|
|
+ GoodsListResponse response = null;
|
|
|
+ if ("run".equals(profiles) || "stage".equals(profiles)) { // 검색엔진을 통한 상품리스트 조회
|
|
|
+ response = diquest.getGoodsList(params);
|
|
|
+ pageable.setTotalCount(response.getTotalCount());
|
|
|
+ dataList = response.getResponse();
|
|
|
+ } else { // DB를 통한 상품리스트 조회
|
|
|
+ pageable.setTotalCount(goodsService.getSearchGoodsCount(params));
|
|
|
+ params.setPageable(pageable);
|
|
|
+ dataList = goodsService.getSearchGoodsList(params);
|
|
|
+ }
|
|
|
|
|
|
log.info("pageable>>>>{}", pageable);
|
|
|
log.info("dataList>>>>{}", dataList);
|
|
|
@@ -1223,16 +1239,18 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
log.info("getSearchGoodsList params::{}", params);
|
|
|
// 검색엔진 연동 여부
|
|
|
// String syncYn = commonService.getSearchEngineSyncYn();
|
|
|
-// if (syncYn.equals("Y")) { // 검색엔진을 통한 상품리스트 조회
|
|
|
- GoodsListResponse response = diquest.getGoodsList(params);
|
|
|
- pageable.setTotalCount(response.getTotalCount());
|
|
|
- dataList = response.getResponse();
|
|
|
-// } else { // DB를 통한 상품리스트 조회
|
|
|
-// pageable.setTotalCount(goodsService.getSearchGoodsCount(params));
|
|
|
-// params.setPageable(pageable);
|
|
|
-// dataList = goodsService.getSearchGoodsList(params);
|
|
|
-// }
|
|
|
- recommendList = response.getRecommend();
|
|
|
+ String profiles = env.getProperty("spring.profiles.active").toLowerCase();
|
|
|
+ GoodsListResponse response = null;
|
|
|
+ if ("run".equals(profiles) || "stage".equals(profiles)) { // 검색엔진을 통한 상품리스트 조회
|
|
|
+ response = diquest.getGoodsList(params);
|
|
|
+ pageable.setTotalCount(response.getTotalCount());
|
|
|
+ dataList = response.getResponse();
|
|
|
+ recommendList = response.getRecommend();
|
|
|
+ } else { // DB를 통한 상품리스트 조회
|
|
|
+ pageable.setTotalCount(goodsService.getSearchGoodsCount(params));
|
|
|
+ params.setPageable(pageable);
|
|
|
+ dataList = goodsService.getSearchGoodsList(params);
|
|
|
+ }
|
|
|
|
|
|
result.set("paging", pageable);
|
|
|
result.set("dataList", dataList);
|
|
|
@@ -1240,7 +1258,7 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 검색상품 리스트 수량 조회
|
|
|
* 검색팝업창에서 추천솔루선 리턴이 0일 때, 검색엔진 결과가 있는지 확인용
|
|
|
@@ -1253,7 +1271,7 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
@ResponseBody
|
|
|
public GagaMap getSearchGoodsListCnt(@RequestBody SearchEngine params) {
|
|
|
GagaMap result = new GagaMap();
|
|
|
-
|
|
|
+
|
|
|
if (TsfSession.isLogin()) {
|
|
|
params.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
}
|
|
|
@@ -1261,10 +1279,10 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
params.setFrontGb(TsfSession.getFrontGb());
|
|
|
params.setCustGb(TsfSession.getCustGb());
|
|
|
log.info("getSearchGoodsList params::{}", params);
|
|
|
-
|
|
|
+
|
|
|
// 검색엔진을 통한 상품리스트 조회
|
|
|
GoodsListResponse response = diquest.getGoodsList(params);
|
|
|
-
|
|
|
+
|
|
|
result.set("response_cnt", response.getTotalCount());
|
|
|
|
|
|
return result;
|