|
@@ -10,6 +10,7 @@ import org.jsoup.nodes.Element;
|
|
import org.jsoup.select.Elements;
|
|
import org.jsoup.select.Elements;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
@@ -54,8 +55,8 @@ public class SysRegionController {
|
|
String href = a.attr("href"); // 11.html
|
|
String href = a.attr("href"); // 11.html
|
|
String name = a.text(); // 浙江省
|
|
String name = a.text(); // 浙江省
|
|
|
|
|
|
- Long id = 18L;
|
|
|
|
- if ("湖南省".equals(name)) {
|
|
|
|
|
|
+ Long id = 20L;
|
|
|
|
+ if ("广西壮族自治区".equals(name)) {
|
|
SysRegion region = new SysRegion();
|
|
SysRegion region = new SysRegion();
|
|
region.setId(id);
|
|
region.setId(id);
|
|
region.setPid(0L);
|
|
region.setPid(0L);
|
|
@@ -84,8 +85,9 @@ public class SysRegionController {
|
|
|
|
|
|
|
|
|
|
@PostMapping("/select")
|
|
@PostMapping("/select")
|
|
- public AjaxResult selectSysRegion(SysRegion sysRegion) throws IOException {
|
|
|
|
- return AjaxResult.success(sysRegionMapper.selectSysRegion(sysRegion));
|
|
|
|
|
|
+ public AjaxResult selectSysRegion(@RequestBody SysRegion sysRegion){
|
|
|
|
+ List<SysRegion> list = sysRegionMapper.selectSysRegion(sysRegion);
|
|
|
|
+ return AjaxResult.success(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -111,7 +113,7 @@ public class SysRegionController {
|
|
String name = nametd.select("a").text(); // 衢州市
|
|
String name = nametd.select("a").text(); // 衢州市
|
|
System.out.println("开始爬取" + name);
|
|
System.out.println("开始爬取" + name);
|
|
|
|
|
|
- if ("益阳市".equals(name) || "郴州市".equals(name)||"永州市".equals(name)||"怀化市".equals(name)) {
|
|
|
|
|
|
+ if ("南宁市".equals(name) || "柳州市".equals(name)|| "桂林市".equals(name)|| "梧州市".equals(name)||"北海市".equals(name)) {
|
|
SysRegion region = new SysRegion();
|
|
SysRegion region = new SysRegion();
|
|
region.setId(Long.valueOf(code));
|
|
region.setId(Long.valueOf(code));
|
|
region.setPid(i);
|
|
region.setPid(i);
|