|
|
@@ -1,9 +1,12 @@
|
|
|
package com.style24.front.biz.thirdparty;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-import org.springframework.web.client.RestTemplate;
|
|
|
+
|
|
|
+import com.style24.persistence.domain.searchengine.SearchEngine;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
@@ -20,21 +23,45 @@ public class SearchEngineDiquest {
|
|
|
@Autowired
|
|
|
private Environment env;
|
|
|
|
|
|
- @Autowired
|
|
|
- private RestTemplate restTemplate;
|
|
|
+ private String ipAddr; // 검색엔진 IP
|
|
|
+ private String port; // 검색엔진 포트
|
|
|
+
|
|
|
+ @PostConstruct
|
|
|
+ public void init() {
|
|
|
+ ipAddr = env.getProperty("search.engine.diquest.ip");
|
|
|
+ port = env.getProperty("search.engine.diquest.port");
|
|
|
|
|
|
- private String ipAddr;
|
|
|
- private String port;
|
|
|
+ log.debug("\n\n---- NHN Diquest initialization started ----");
|
|
|
+ log.debug("ipAddr: [{}]", ipAddr);
|
|
|
+ log.debug("port: [{}]", port);
|
|
|
+ log.debug("\n--- NHN Diquest initialization completed ----\n");
|
|
|
+ }
|
|
|
|
|
|
-// @PostConstruct
|
|
|
-// public void init() {
|
|
|
-// ipAddr = env.getProperty("search.engine.diquest.ip");
|
|
|
-// port = env.getProperty("search.engine.diquest.port");
|
|
|
+ /**
|
|
|
+ * 인기검색어 조회
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 5. 10
|
|
|
+ */
|
|
|
+ public SearchEngine getTrendKeywordList() {
|
|
|
+ SearchEngine result = new SearchEngine();
|
|
|
+
|
|
|
+// // 인기검색어
|
|
|
+// Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+// map.put("adminIp", ipAddr);
|
|
|
+// map.put("adminPort", port);
|
|
|
+//
|
|
|
+// try {
|
|
|
+// JSONObject jsonObj = AutoSearch.trendKeyword(map);
|
|
|
+// log.info("jsonObj.toJSONString(): {}", jsonObj.toJSONString());
|
|
|
//
|
|
|
-// log.debug("\n\n---- NHN Diquest initialization started ----");
|
|
|
-// log.debug("ipAddr: [{}]", ipAddr);
|
|
|
-// log.debug("port: [{}]", port);
|
|
|
-// log.debug("\n--- NHN Diquest initialization completed ----\n");
|
|
|
-// }
|
|
|
+// Gson gson = new Gson();
|
|
|
+// result = gson.fromJson(jsonObj.toJSONString(), SearchEngine.class);
|
|
|
+// } catch (IRException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
}
|