This commit is contained in:
landaiqing 2023-12-23 21:26:29 +08:00
parent c06850be14
commit a7172446ce
2 changed files with 11 additions and 9 deletions

View File

@ -192,13 +192,6 @@ public class UrlAndCateController {
Set<String> parentSet = new HashSet<>(); Set<String> parentSet = new HashSet<>();
for( int i = 0 ; i < urlLists.size() ; i++) for( int i = 0 ; i < urlLists.size() ; i++)
{ {
CateAndUrl cateAndUrl = new CateAndUrl();
cateAndUrl.setFloder("false");
cateAndUrl.setName(urlLists.get(i).getName());
cateAndUrl.setParentId(urlLists.get(i).getCateId());
cateAndUrl.setUrlId(urlLists.get(i).getId());
cateAndUrl.setUrl(urlLists.get(i).getUrl());
cateAndUrlList.add(cateAndUrl);
String parentString = urlCateListService.selectUrListCateByUrlCateId(urlLists.get(i).getCateId()); String parentString = urlCateListService.selectUrListCateByUrlCateId(urlLists.get(i).getCateId());
String [] parentList = parentString.split(","); String [] parentList = parentString.split(",");
System.out.println(parentString); System.out.println(parentString);
@ -220,7 +213,16 @@ public class UrlAndCateController {
cateAndUrl.setCateId(urlCateList.getId()); cateAndUrl.setCateId(urlCateList.getId());
cateAndUrlList.add(cateAndUrl); cateAndUrlList.add(cateAndUrl);
} }
Collections.reverse(cateAndUrlList); // for( int i = 0 ; i < urlLists.size() ; i++)
// {
// CateAndUrl cateAndUrl = new CateAndUrl();
// cateAndUrl.setFloder("false");
// cateAndUrl.setName(urlLists.get(i).getName());
// cateAndUrl.setParentId(urlLists.get(i).getCateId());
// cateAndUrl.setUrlId(urlLists.get(i).getId());
// cateAndUrl.setUrl(urlLists.get(i).getUrl());
// cateAndUrlList.add(cateAndUrl);
// }
System.out.println(cateAndUrlList); System.out.println(cateAndUrlList);
List<CateAndUrl> parentsList = new ArrayList<>(); List<CateAndUrl> parentsList = new ArrayList<>();
@ -399,6 +401,7 @@ public class UrlAndCateController {
e.printStackTrace(); e.printStackTrace();
result.put("code", 500); result.put("code", 500);
result.put("msg", "url不可用"); result.put("msg", "url不可用");
return JSONObject.toJSONString(result);
// handle error // handle error
} }
result.put("code", 200); result.put("code", 200);

View File

@ -4,7 +4,6 @@ import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import sun.net.www.protocol.http.HttpURLConnection;
import java.io.IOException; import java.io.IOException;
import java.net.*; import java.net.*;