Merge branch 'tolag3'

This commit is contained in:
leejunho 2025-01-22 17:57:07 +09:00
commit 6f33aac8a3

View File

@ -33,6 +33,7 @@ import javax.net.ssl.X509TrustManager;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.ui.ModelMap;
import org.springframework.web.client.RestTemplate;
@ -373,18 +374,24 @@ public class FairnetUtils {
String url = new SearchGlobalSet().getHost()
+ "/srch_resultjson?"
+ "w=" + searchType
+ "&q=" + searchKeyword
+ "&q=" + "*" + searchKeyword + "*"
+ "&outmax=" + pagingSize
+ "&section="
+ "&pg=" + page;
try {
String response = new RestTemplate().getForObject(url, String.class);
response = response.replaceAll("\n", "\\n");
response = response.replaceAll("\r", "\\r");
JsonNode root = new ObjectMapper().readTree(response);
JsonNode listNode = root.path("section_list")
.path(0)
.path("section")
.path(0);
if (listNode.path("att_list").isArray()) {
if (
listNode.path("att_list").isArray()
&& !"\"\"".equals(listNode.path("att_list").get(0).toString())
) {
List<SearchVO> searchList = new ObjectMapper().convertValue(
listNode.path("att_list"), new TypeReference<List<SearchVO>>() {}
);