|
|
@@ -12,18 +12,20 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import com.diquest.ir.common.exception.IRException;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.style24.front.biz.dao.TsfDisplayDao;
|
|
|
import com.style24.persistence.domain.Cate1;
|
|
|
+import com.style24.persistence.domain.searchengine.AutoCompleteResponse;
|
|
|
import com.style24.persistence.domain.searchengine.CateResponse;
|
|
|
import com.style24.persistence.domain.searchengine.Filter;
|
|
|
import com.style24.persistence.domain.searchengine.FilterResponse;
|
|
|
import com.style24.persistence.domain.searchengine.GoodsListResponse;
|
|
|
+import com.style24.persistence.domain.searchengine.PlanningResponse;
|
|
|
import com.style24.persistence.domain.searchengine.SearchEngine;
|
|
|
|
|
|
import istyle.AutoSearch;
|
|
|
+import istyle.PlanSearch;
|
|
|
import istyle.SearchService;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -80,7 +82,37 @@ public class SearchEngineDiquest {
|
|
|
Gson gson = new Gson();
|
|
|
result = gson.fromJson(jsonObj.toJSONString(), SearchEngine.class);
|
|
|
log.info("///[getTrendKeywordList] result: {}", result);
|
|
|
- } catch (IRException e) {
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 자동완성 조회
|
|
|
+ * @param keyword - 검색어
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 6. 7
|
|
|
+ */
|
|
|
+ public AutoCompleteResponse getAutoComplete(String keyword) {
|
|
|
+ AutoCompleteResponse result = new AutoCompleteResponse();
|
|
|
+
|
|
|
+ Map<String, Object> paramMap = new HashMap<String, Object>();
|
|
|
+ paramMap.put("adminIp", ipAddr);
|
|
|
+ paramMap.put("adminPort", port);
|
|
|
+ paramMap.put("keyword", keyword);
|
|
|
+ log.info("///[getAutoComplete] paramMap: {}", paramMap);
|
|
|
+
|
|
|
+ try {
|
|
|
+ JSONObject jsonObj = AutoSearch.getAutoComplete(paramMap);
|
|
|
+ log.info("///[getAutoComplete] jsonObj: {}", jsonObj.toJSONString());
|
|
|
+
|
|
|
+ Gson gson = new Gson();
|
|
|
+ result = gson.fromJson(jsonObj.toJSONString(), AutoCompleteResponse.class);
|
|
|
+ log.info("///[getAutoComplete] result: {}", result);
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
@@ -196,6 +228,74 @@ public class SearchEngineDiquest {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 기획전 목록
|
|
|
+ * @param keyword - 검색어
|
|
|
+ * @param pageNo - 페이지번호
|
|
|
+ * @param pageSize - 페이지사이즈
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 6. 7
|
|
|
+ */
|
|
|
+ public PlanningResponse getPlanningList(String keyword, int pageNo, int pageSize) {
|
|
|
+ PlanningResponse result = new PlanningResponse();
|
|
|
+
|
|
|
+ Map<String, Object> paramMap = new HashMap<String, Object>();
|
|
|
+ paramMap.put("adminIp", ipAddr);
|
|
|
+ paramMap.put("adminPort", port);
|
|
|
+ paramMap.put("keyword", keyword);
|
|
|
+ paramMap.put("pageNumber", String.valueOf(pageNo));
|
|
|
+ paramMap.put("rowsPerPage", String.valueOf(pageSize));
|
|
|
+ log.info("///[getPlanningList] paramMap: {}", paramMap);
|
|
|
+
|
|
|
+ try {
|
|
|
+ JSONObject jsonObj = PlanSearch.planSearchApi(paramMap);
|
|
|
+ log.info("///[getPlanningList] jsonObj: {}", jsonObj.toJSONString());
|
|
|
+
|
|
|
+ Gson gson = new Gson();
|
|
|
+ result = gson.fromJson(jsonObj.toJSONString(), PlanningResponse.class);
|
|
|
+ log.info("///[getPlanningList] result: {}", result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 이벤트 목록
|
|
|
+ * @param keyword - 검색어
|
|
|
+ * @param pageNo - 페이지번호
|
|
|
+ * @param pageSize - 페이지사이즈
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 6. 7
|
|
|
+ */
|
|
|
+ public PlanningResponse getEventList(String keyword, int pageNo, int pageSize) {
|
|
|
+ PlanningResponse result = new PlanningResponse();
|
|
|
+
|
|
|
+ Map<String, Object> paramMap = new HashMap<String, Object>();
|
|
|
+ paramMap.put("adminIp", ipAddr);
|
|
|
+ paramMap.put("adminPort", port);
|
|
|
+ paramMap.put("keyword", keyword);
|
|
|
+ paramMap.put("pageNumber", String.valueOf(pageNo));
|
|
|
+ paramMap.put("rowsPerPage", String.valueOf(pageSize));
|
|
|
+ log.info("///[getEventList] paramMap: {}", paramMap);
|
|
|
+
|
|
|
+ try {
|
|
|
+ JSONObject jsonObj = PlanSearch.planSearchApi(paramMap);
|
|
|
+ log.info("///[getEventList] jsonObj: {}", jsonObj.toJSONString());
|
|
|
+
|
|
|
+ Gson gson = new Gson();
|
|
|
+ result = gson.fromJson(jsonObj.toJSONString(), PlanningResponse.class);
|
|
|
+ log.info("///[getEventList] result: {}", result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Object를 Map으로 변환
|
|
|
* @param obj - Object
|