x1ongzhu 6 ani în urmă
părinte
comite
e4dbb83dca
37 a modificat fișierele cu 3249 adăugiri și 37 ștergeri
  1. 2374 0
      city.json
  2. 6 0
      pom.xml
  3. 2 0
      src/main/java/com/izouma/walkchina/WalkChinaApplication.java
  4. 13 0
      src/main/java/com/izouma/walkchina/bean/Location.java
  5. 13 0
      src/main/java/com/izouma/walkchina/bean/MapRegion.java
  6. 1 1
      src/main/java/com/izouma/walkchina/bean/Result.java
  7. 21 0
      src/main/java/com/izouma/walkchina/bean/UserMap.java
  8. 23 0
      src/main/java/com/izouma/walkchina/bean/webservice/DirectionResponse.java
  9. 27 0
      src/main/java/com/izouma/walkchina/bean/webservice/MapRoute.java
  10. 26 0
      src/main/java/com/izouma/walkchina/bean/webservice/RouteStep.java
  11. 21 0
      src/main/java/com/izouma/walkchina/bean/webservice/WayPoint.java
  12. 23 0
      src/main/java/com/izouma/walkchina/converter/DoubleArrayConverter.java
  13. 29 0
      src/main/java/com/izouma/walkchina/converter/RouteStepConverter.java
  14. 32 0
      src/main/java/com/izouma/walkchina/domain/BaseEntity.java
  15. 31 0
      src/main/java/com/izouma/walkchina/domain/City.java
  16. 57 0
      src/main/java/com/izouma/walkchina/domain/JourneyStage.java
  17. 29 0
      src/main/java/com/izouma/walkchina/domain/Province.java
  18. 8 20
      src/main/java/com/izouma/walkchina/domain/UserInfo.java
  19. 41 0
      src/main/java/com/izouma/walkchina/domain/UserJourney.java
  20. 1 1
      src/main/java/com/izouma/walkchina/exception/GlobalExceptionHandler.java
  21. 8 0
      src/main/java/com/izouma/walkchina/repo/CityRepository.java
  22. 10 0
      src/main/java/com/izouma/walkchina/repo/JourneyStageRepository.java
  23. 7 0
      src/main/java/com/izouma/walkchina/repo/ProvinceRepository.java
  24. 8 0
      src/main/java/com/izouma/walkchina/repo/UserJourneyRepository.java
  25. 8 0
      src/main/java/com/izouma/walkchina/service/JourneyService.java
  26. 116 0
      src/main/java/com/izouma/walkchina/service/MapService.java
  27. 4 2
      src/main/java/com/izouma/walkchina/service/UserInfoService.java
  28. 13 1
      src/main/java/com/izouma/walkchina/web/AuthenticationController.java
  29. 1 1
      src/main/java/com/izouma/walkchina/web/FileUploadController.java
  30. 24 0
      src/main/java/com/izouma/walkchina/web/MapController.java
  31. 1 10
      src/main/java/com/izouma/walkchina/web/UserInfoController.java
  32. 1 1
      src/main/resources/application.yaml
  33. 106 0
      src/test/java/com/izouma/walkchina/repo/CityRepositoryTest.java
  34. 57 0
      src/test/java/com/izouma/walkchina/repo/ProvinceRepositoryTest.java
  35. 65 0
      src/test/java/com/izouma/walkchina/service/MapServiceTest.java
  36. 27 0
      src/test/java/com/izouma/walkchina/service/UserInfoServiceTest.java
  37. 15 0
      src/test/java/com/izouma/walkchina/web/UserInfoControllerTest.java

+ 2374 - 0
city.json

@@ -0,0 +1,2374 @@
+{
+  "A": [
+    {
+      "pinyin": "a la shan",
+      "name": "阿拉善",
+      "id": 152900,
+      "fullname": "阿拉善盟"
+    },
+    {
+      "pinyin": "an shan",
+      "name": "鞍山",
+      "id": 210300,
+      "fullname": "鞍山市"
+    },
+    {
+      "pinyin": "an qing",
+      "name": "安庆",
+      "id": 340800,
+      "fullname": "安庆市"
+    },
+    {
+      "pinyin": "an yang",
+      "name": "安阳",
+      "id": 410500,
+      "fullname": "安阳市"
+    },
+    {
+      "pinyin": "a ba",
+      "name": "阿坝",
+      "id": 513200,
+      "fullname": "阿坝藏族羌族自治州"
+    },
+    {
+      "pinyin": "an shun",
+      "name": "安顺",
+      "id": 520400,
+      "fullname": "安顺市"
+    },
+    {
+      "pinyin": "a li",
+      "name": "阿里",
+      "id": 542500,
+      "fullname": "阿里地区"
+    },
+    {
+      "pinyin": "an kang",
+      "name": "安康",
+      "id": 610900,
+      "fullname": "安康市"
+    },
+    {
+      "pinyin": "a ke su",
+      "name": "阿克苏",
+      "id": 652900,
+      "fullname": "阿克苏地区"
+    },
+    {
+      "pinyin": "a le tai",
+      "name": "阿勒泰",
+      "id": 654300,
+      "fullname": "阿勒泰地区"
+    },
+    {
+      "pinyin": "a la er",
+      "name": "阿拉尔",
+      "id": 659002,
+      "fullname": "阿拉尔市"
+    },
+    {
+      "pinyin": "ao men",
+      "name": "澳门",
+      "id": 820000,
+      "fullname": "澳门特别行政区"
+    }
+  ],
+  "B": [
+    {
+      "pinyin": "bei jing",
+      "name": "北京",
+      "id": 110000,
+      "fullname": "北京市"
+    },
+    {
+      "pinyin": "bao ding",
+      "name": "保定",
+      "id": 130600,
+      "fullname": "保定市"
+    },
+    {
+      "pinyin": "bao tou",
+      "name": "包头",
+      "id": 150200,
+      "fullname": "包头市"
+    },
+    {
+      "pinyin": "ba yan nao er",
+      "name": "巴彦淖尔",
+      "id": 150800,
+      "fullname": "巴彦淖尔市"
+    },
+    {
+      "pinyin": "ben xi",
+      "name": "本溪",
+      "id": 210500,
+      "fullname": "本溪市"
+    },
+    {
+      "pinyin": "bai shan",
+      "name": "白山",
+      "id": 220600,
+      "fullname": "白山市"
+    },
+    {
+      "pinyin": "bai cheng",
+      "name": "白城",
+      "id": 220800,
+      "fullname": "白城市"
+    },
+    {
+      "pinyin": "beng bu",
+      "name": "蚌埠",
+      "id": 340300,
+      "fullname": "蚌埠市"
+    },
+    {
+      "pinyin": "bo zhou",
+      "name": "亳州",
+      "id": 341600,
+      "fullname": "亳州市"
+    },
+    {
+      "pinyin": "bin zhou",
+      "name": "滨州",
+      "id": 371600,
+      "fullname": "滨州市"
+    },
+    {
+      "pinyin": "bei hai",
+      "name": "北海",
+      "id": 450500,
+      "fullname": "北海市"
+    },
+    {
+      "pinyin": "bai se",
+      "name": "百色",
+      "id": 451000,
+      "fullname": "百色市"
+    },
+    {
+      "pinyin": "bai sha",
+      "name": "白沙",
+      "id": 469025,
+      "fullname": "白沙黎族自治县"
+    },
+    {
+      "pinyin": "bao ting",
+      "name": "保亭",
+      "id": 469029,
+      "fullname": "保亭黎族苗族自治县"
+    },
+    {
+      "pinyin": "ba zhong",
+      "name": "巴中",
+      "id": 511900,
+      "fullname": "巴中市"
+    },
+    {
+      "pinyin": "bi jie",
+      "name": "毕节",
+      "id": 520500,
+      "fullname": "毕节市"
+    },
+    {
+      "pinyin": "bao shan",
+      "name": "保山",
+      "id": 530500,
+      "fullname": "保山市"
+    },
+    {
+      "pinyin": "bao ji",
+      "name": "宝鸡",
+      "id": 610300,
+      "fullname": "宝鸡市"
+    },
+    {
+      "pinyin": "bai yin",
+      "name": "白银",
+      "id": 620400,
+      "fullname": "白银市"
+    },
+    {
+      "pinyin": "bo zhou",
+      "name": "博州",
+      "id": 652700,
+      "fullname": "博尔塔拉蒙古自治州"
+    },
+    {
+      "pinyin": "ba zhou",
+      "name": "巴州",
+      "id": 652800,
+      "fullname": "巴音郭楞蒙古自治州"
+    },
+    {
+      "pinyin": "bei tun",
+      "name": "北屯",
+      "id": 659005,
+      "fullname": "北屯市"
+    }
+  ],
+  "C": [
+    {
+      "pinyin": "cheng de",
+      "name": "承德",
+      "id": 130800,
+      "fullname": "承德市"
+    },
+    {
+      "pinyin": "cang zhou",
+      "name": "沧州",
+      "id": 130900,
+      "fullname": "沧州市"
+    },
+    {
+      "pinyin": "chang zhi",
+      "name": "长治",
+      "id": 140400,
+      "fullname": "长治市"
+    },
+    {
+      "pinyin": "chi feng",
+      "name": "赤峰",
+      "id": 150400,
+      "fullname": "赤峰市"
+    },
+    {
+      "pinyin": "chao yang",
+      "name": "朝阳",
+      "id": 211300,
+      "fullname": "朝阳市"
+    },
+    {
+      "pinyin": "chang chun",
+      "name": "长春",
+      "id": 220100,
+      "fullname": "长春市"
+    },
+    {
+      "pinyin": "chang zhou",
+      "name": "常州",
+      "id": 320400,
+      "fullname": "常州市"
+    },
+    {
+      "pinyin": "chu zhou",
+      "name": "滁州",
+      "id": 341100,
+      "fullname": "滁州市"
+    },
+    {
+      "pinyin": "chi zhou",
+      "name": "池州",
+      "id": 341700,
+      "fullname": "池州市"
+    },
+    {
+      "pinyin": "chang sha",
+      "name": "长沙",
+      "id": 430100,
+      "fullname": "长沙市"
+    },
+    {
+      "pinyin": "chang de",
+      "name": "常德",
+      "id": 430700,
+      "fullname": "常德市"
+    },
+    {
+      "pinyin": "chen zhou",
+      "name": "郴州",
+      "id": 431000,
+      "fullname": "郴州市"
+    },
+    {
+      "pinyin": "chao zhou",
+      "name": "潮州",
+      "id": 445100,
+      "fullname": "潮州市"
+    },
+    {
+      "pinyin": "chong zuo",
+      "name": "崇左",
+      "id": 451400,
+      "fullname": "崇左市"
+    },
+    {
+      "pinyin": "cheng mai",
+      "name": "澄迈",
+      "id": 469023,
+      "fullname": "澄迈县"
+    },
+    {
+      "pinyin": "chang jiang",
+      "name": "昌江",
+      "id": 469026,
+      "fullname": "昌江黎族自治县"
+    },
+    {
+      "pinyin": "chong qing",
+      "name": "重庆",
+      "id": 500000,
+      "fullname": "重庆市"
+    },
+    {
+      "pinyin": "cheng du",
+      "name": "成都",
+      "id": 510100,
+      "fullname": "成都市"
+    },
+    {
+      "pinyin": "chu xiong",
+      "name": "楚雄",
+      "id": 532300,
+      "fullname": "楚雄彝族自治州"
+    },
+    {
+      "pinyin": "chang du",
+      "name": "昌都",
+      "id": 540300,
+      "fullname": "昌都市"
+    },
+    {
+      "pinyin": "chang ji",
+      "name": "昌吉",
+      "id": 652300,
+      "fullname": "昌吉回族自治州"
+    }
+  ],
+  "D": [
+    {
+      "pinyin": "da tong",
+      "name": "大同",
+      "id": 140200,
+      "fullname": "大同市"
+    },
+    {
+      "pinyin": "da lian",
+      "name": "大连",
+      "id": 210200,
+      "fullname": "大连市"
+    },
+    {
+      "pinyin": "dan dong",
+      "name": "丹东",
+      "id": 210600,
+      "fullname": "丹东市"
+    },
+    {
+      "pinyin": "da qing",
+      "name": "大庆",
+      "id": 230600,
+      "fullname": "大庆市"
+    },
+    {
+      "pinyin": "da xing an ling",
+      "name": "大兴安岭",
+      "id": 232700,
+      "fullname": "大兴安岭地区"
+    },
+    {
+      "pinyin": "dong ying",
+      "name": "东营",
+      "id": 370500,
+      "fullname": "东营市"
+    },
+    {
+      "pinyin": "de zhou",
+      "name": "德州",
+      "id": 371400,
+      "fullname": "德州市"
+    },
+    {
+      "pinyin": "dong guan",
+      "name": "东莞",
+      "id": 441900,
+      "fullname": "东莞市"
+    },
+    {
+      "pinyin": "dan zhou",
+      "name": "儋州",
+      "id": 460400,
+      "fullname": "儋州市"
+    },
+    {
+      "pinyin": "dong fang",
+      "name": "东方",
+      "id": 469007,
+      "fullname": "东方市"
+    },
+    {
+      "pinyin": "ding an",
+      "name": "定安",
+      "id": 469021,
+      "fullname": "定安县"
+    },
+    {
+      "pinyin": "de yang",
+      "name": "德阳",
+      "id": 510600,
+      "fullname": "德阳市"
+    },
+    {
+      "pinyin": "da zhou",
+      "name": "达州",
+      "id": 511700,
+      "fullname": "达州市"
+    },
+    {
+      "pinyin": "da li",
+      "name": "大理",
+      "id": 532900,
+      "fullname": "大理白族自治州"
+    },
+    {
+      "pinyin": "de hong",
+      "name": "德宏",
+      "id": 533100,
+      "fullname": "德宏傣族景颇族自治州"
+    },
+    {
+      "pinyin": "di qing",
+      "name": "迪庆",
+      "id": 533400,
+      "fullname": "迪庆藏族自治州"
+    },
+    {
+      "pinyin": "ding xi",
+      "name": "定西",
+      "id": 621100,
+      "fullname": "定西市"
+    }
+  ],
+  "E": [
+    {
+      "pinyin": "e er duo si",
+      "name": "鄂尔多斯",
+      "id": 150600,
+      "fullname": "鄂尔多斯市"
+    },
+    {
+      "pinyin": "e zhou",
+      "name": "鄂州",
+      "id": 420700,
+      "fullname": "鄂州市"
+    },
+    {
+      "pinyin": "en shi",
+      "name": "恩施",
+      "id": 422800,
+      "fullname": "恩施土家族苗族自治州"
+    }
+  ],
+  "F": [
+    {
+      "pinyin": "fu shun",
+      "name": "抚顺",
+      "id": 210400,
+      "fullname": "抚顺市"
+    },
+    {
+      "pinyin": "fu xin",
+      "name": "阜新",
+      "id": 210900,
+      "fullname": "阜新市"
+    },
+    {
+      "pinyin": "fu yang",
+      "name": "阜阳",
+      "id": 341200,
+      "fullname": "阜阳市"
+    },
+    {
+      "pinyin": "fu zhou",
+      "name": "福州",
+      "id": 350100,
+      "fullname": "福州市"
+    },
+    {
+      "pinyin": "fu zhou",
+      "name": "抚州",
+      "id": 361000,
+      "fullname": "抚州市"
+    },
+    {
+      "pinyin": "fo shan",
+      "name": "佛山",
+      "id": 440600,
+      "fullname": "佛山市"
+    },
+    {
+      "pinyin": "fang cheng gang",
+      "name": "防城港",
+      "id": 450600,
+      "fullname": "防城港市"
+    }
+  ],
+  "G": [
+    {
+      "pinyin": "gan zhou",
+      "name": "赣州",
+      "id": 360700,
+      "fullname": "赣州市"
+    },
+    {
+      "pinyin": "guang zhou",
+      "name": "广州",
+      "id": 440100,
+      "fullname": "广州市"
+    },
+    {
+      "pinyin": "gui lin",
+      "name": "桂林",
+      "id": 450300,
+      "fullname": "桂林市"
+    },
+    {
+      "pinyin": "gui gang",
+      "name": "贵港",
+      "id": 450800,
+      "fullname": "贵港市"
+    },
+    {
+      "pinyin": "guang yuan",
+      "name": "广元",
+      "id": 510800,
+      "fullname": "广元市"
+    },
+    {
+      "pinyin": "guang an",
+      "name": "广安",
+      "id": 511600,
+      "fullname": "广安市"
+    },
+    {
+      "pinyin": "gan zi",
+      "name": "甘孜",
+      "id": 513300,
+      "fullname": "甘孜藏族自治州"
+    },
+    {
+      "pinyin": "gui yang",
+      "name": "贵阳",
+      "id": 520100,
+      "fullname": "贵阳市"
+    },
+    {
+      "pinyin": "gan nan",
+      "name": "甘南",
+      "id": 623000,
+      "fullname": "甘南藏族自治州"
+    },
+    {
+      "pinyin": "guo luo",
+      "name": "果洛",
+      "id": 632600,
+      "fullname": "果洛藏族自治州"
+    },
+    {
+      "pinyin": "gu yuan",
+      "name": "固原",
+      "id": 640400,
+      "fullname": "固原市"
+    },
+    {
+      "pinyin": "gao xiong",
+      "name": "高雄",
+      "id": 710200,
+      "fullname": "高雄市"
+    }
+  ],
+  "H": [
+    {
+      "pinyin": "han dan",
+      "name": "邯郸",
+      "id": 130400,
+      "fullname": "邯郸市"
+    },
+    {
+      "pinyin": "heng shui",
+      "name": "衡水",
+      "id": 131100,
+      "fullname": "衡水市"
+    },
+    {
+      "pinyin": "hu he hao te",
+      "name": "呼和浩特",
+      "id": 150100,
+      "fullname": "呼和浩特市"
+    },
+    {
+      "pinyin": "hu lun bei er",
+      "name": "呼伦贝尔",
+      "id": 150700,
+      "fullname": "呼伦贝尔市"
+    },
+    {
+      "pinyin": "hu lu dao",
+      "name": "葫芦岛",
+      "id": 211400,
+      "fullname": "葫芦岛市"
+    },
+    {
+      "pinyin": "ha er bin",
+      "name": "哈尔滨",
+      "id": 230100,
+      "fullname": "哈尔滨市"
+    },
+    {
+      "pinyin": "he gang",
+      "name": "鹤岗",
+      "id": 230400,
+      "fullname": "鹤岗市"
+    },
+    {
+      "pinyin": "hei he",
+      "name": "黑河",
+      "id": 231100,
+      "fullname": "黑河市"
+    },
+    {
+      "pinyin": "huai an",
+      "name": "淮安",
+      "id": 320800,
+      "fullname": "淮安市"
+    },
+    {
+      "pinyin": "hang zhou",
+      "name": "杭州",
+      "id": 330100,
+      "fullname": "杭州市"
+    },
+    {
+      "pinyin": "hu zhou",
+      "name": "湖州",
+      "id": 330500,
+      "fullname": "湖州市"
+    },
+    {
+      "pinyin": "he fei",
+      "name": "合肥",
+      "id": 340100,
+      "fullname": "合肥市"
+    },
+    {
+      "pinyin": "huai nan",
+      "name": "淮南",
+      "id": 340400,
+      "fullname": "淮南市"
+    },
+    {
+      "pinyin": "huai bei",
+      "name": "淮北",
+      "id": 340600,
+      "fullname": "淮北市"
+    },
+    {
+      "pinyin": "huang shan",
+      "name": "黄山",
+      "id": 341000,
+      "fullname": "黄山市"
+    },
+    {
+      "pinyin": "he ze",
+      "name": "菏泽",
+      "id": 371700,
+      "fullname": "菏泽市"
+    },
+    {
+      "pinyin": "he bi",
+      "name": "鹤壁",
+      "id": 410600,
+      "fullname": "鹤壁市"
+    },
+    {
+      "pinyin": "huang shi",
+      "name": "黄石",
+      "id": 420200,
+      "fullname": "黄石市"
+    },
+    {
+      "pinyin": "huang gang",
+      "name": "黄冈",
+      "id": 421100,
+      "fullname": "黄冈市"
+    },
+    {
+      "pinyin": "heng yang",
+      "name": "衡阳",
+      "id": 430400,
+      "fullname": "衡阳市"
+    },
+    {
+      "pinyin": "huai hua",
+      "name": "怀化",
+      "id": 431200,
+      "fullname": "怀化市"
+    },
+    {
+      "pinyin": "hui zhou",
+      "name": "惠州",
+      "id": 441300,
+      "fullname": "惠州市"
+    },
+    {
+      "pinyin": "he yuan",
+      "name": "河源",
+      "id": 441600,
+      "fullname": "河源市"
+    },
+    {
+      "pinyin": "he zhou",
+      "name": "贺州",
+      "id": 451100,
+      "fullname": "贺州市"
+    },
+    {
+      "pinyin": "he chi",
+      "name": "河池",
+      "id": 451200,
+      "fullname": "河池市"
+    },
+    {
+      "pinyin": "hai kou",
+      "name": "海口",
+      "id": 460100,
+      "fullname": "海口市"
+    },
+    {
+      "pinyin": "hong he",
+      "name": "红河",
+      "id": 532500,
+      "fullname": "红河哈尼族彝族自治州"
+    },
+    {
+      "pinyin": "han zhong",
+      "name": "汉中",
+      "id": 610700,
+      "fullname": "汉中市"
+    },
+    {
+      "pinyin": "hai dong",
+      "name": "海东",
+      "id": 630200,
+      "fullname": "海东市"
+    },
+    {
+      "pinyin": "hai bei",
+      "name": "海北",
+      "id": 632200,
+      "fullname": "海北藏族自治州"
+    },
+    {
+      "pinyin": "huang nan",
+      "name": "黄南",
+      "id": 632300,
+      "fullname": "黄南藏族自治州"
+    },
+    {
+      "pinyin": "hai nan",
+      "name": "海南",
+      "id": 632500,
+      "fullname": "海南藏族自治州"
+    },
+    {
+      "pinyin": "hai xi",
+      "name": "海西",
+      "id": 632800,
+      "fullname": "海西蒙古族藏族自治州"
+    },
+    {
+      "pinyin": "ha mi",
+      "name": "哈密",
+      "id": 650500,
+      "fullname": "哈密市"
+    },
+    {
+      "pinyin": "he tian",
+      "name": "和田",
+      "id": 653200,
+      "fullname": "和田地区"
+    },
+    {
+      "pinyin": "hua lian",
+      "name": "花莲",
+      "id": 712600,
+      "fullname": "花莲县"
+    }
+  ],
+  "J": [
+    {
+      "pinyin": "jin cheng",
+      "name": "晋城",
+      "id": 140500,
+      "fullname": "晋城市"
+    },
+    {
+      "pinyin": "jin zhong",
+      "name": "晋中",
+      "id": 140700,
+      "fullname": "晋中市"
+    },
+    {
+      "pinyin": "jin zhou",
+      "name": "锦州",
+      "id": 210700,
+      "fullname": "锦州市"
+    },
+    {
+      "pinyin": "ji lin",
+      "name": "吉林",
+      "id": 220200,
+      "fullname": "吉林市"
+    },
+    {
+      "pinyin": "ji xi",
+      "name": "鸡西",
+      "id": 230300,
+      "fullname": "鸡西市"
+    },
+    {
+      "pinyin": "jia mu si",
+      "name": "佳木斯",
+      "id": 230800,
+      "fullname": "佳木斯市"
+    },
+    {
+      "pinyin": "jia xing",
+      "name": "嘉兴",
+      "id": 330400,
+      "fullname": "嘉兴市"
+    },
+    {
+      "pinyin": "jin hua",
+      "name": "金华",
+      "id": 330700,
+      "fullname": "金华市"
+    },
+    {
+      "pinyin": "jing de zhen",
+      "name": "景德镇",
+      "id": 360200,
+      "fullname": "景德镇市"
+    },
+    {
+      "pinyin": "jiu jiang",
+      "name": "九江",
+      "id": 360400,
+      "fullname": "九江市"
+    },
+    {
+      "pinyin": "ji an",
+      "name": "吉安",
+      "id": 360800,
+      "fullname": "吉安市"
+    },
+    {
+      "pinyin": "ji nan",
+      "name": "济南",
+      "id": 370100,
+      "fullname": "济南市"
+    },
+    {
+      "pinyin": "ji ning",
+      "name": "济宁",
+      "id": 370800,
+      "fullname": "济宁市"
+    },
+    {
+      "pinyin": "jiao zuo",
+      "name": "焦作",
+      "id": 410800,
+      "fullname": "焦作市"
+    },
+    {
+      "pinyin": "ji yuan",
+      "name": "济源",
+      "id": 419001,
+      "fullname": "济源市"
+    },
+    {
+      "pinyin": "jing men",
+      "name": "荆门",
+      "id": 420800,
+      "fullname": "荆门市"
+    },
+    {
+      "pinyin": "jing zhou",
+      "name": "荆州",
+      "id": 421000,
+      "fullname": "荆州市"
+    },
+    {
+      "pinyin": "jiang men",
+      "name": "江门",
+      "id": 440700,
+      "fullname": "江门市"
+    },
+    {
+      "pinyin": "jie yang",
+      "name": "揭阳",
+      "id": 445200,
+      "fullname": "揭阳市"
+    },
+    {
+      "pinyin": "jia yu guan",
+      "name": "嘉峪关",
+      "id": 620200,
+      "fullname": "嘉峪关市"
+    },
+    {
+      "pinyin": "jin chang",
+      "name": "金昌",
+      "id": 620300,
+      "fullname": "金昌市"
+    },
+    {
+      "pinyin": "jiu quan",
+      "name": "酒泉",
+      "id": 620900,
+      "fullname": "酒泉市"
+    },
+    {
+      "pinyin": "ji long",
+      "name": "基隆",
+      "id": 710700,
+      "fullname": "基隆市"
+    },
+    {
+      "pinyin": "jia yi",
+      "name": "嘉义",
+      "id": 710900,
+      "fullname": "嘉义市"
+    },
+    {
+      "pinyin": "jia yi",
+      "name": "嘉义",
+      "id": 711900,
+      "fullname": "嘉义县"
+    }
+  ],
+  "K": [
+    {
+      "pinyin": "kai feng",
+      "name": "开封",
+      "id": 410200,
+      "fullname": "开封市"
+    },
+    {
+      "pinyin": "kun ming",
+      "name": "昆明",
+      "id": 530100,
+      "fullname": "昆明市"
+    },
+    {
+      "pinyin": "ke la ma yi",
+      "name": "克拉玛依",
+      "id": 650200,
+      "fullname": "克拉玛依市"
+    },
+    {
+      "pinyin": "ke zhou",
+      "name": "克州",
+      "id": 653000,
+      "fullname": "克孜勒苏柯尔克孜自治州"
+    },
+    {
+      "pinyin": "ka shi",
+      "name": "喀什",
+      "id": 653100,
+      "fullname": "喀什地区"
+    },
+    {
+      "pinyin": "ke ke da la",
+      "name": "可克达拉",
+      "id": 659008,
+      "fullname": "可克达拉市"
+    },
+    {
+      "pinyin": "kun yu",
+      "name": "昆玉",
+      "id": 659009,
+      "fullname": "昆玉市"
+    }
+  ],
+  "L": [
+    {
+      "pinyin": "lang fang",
+      "name": "廊坊",
+      "id": 131000,
+      "fullname": "廊坊市"
+    },
+    {
+      "pinyin": "lin fen",
+      "name": "临汾",
+      "id": 141000,
+      "fullname": "临汾市"
+    },
+    {
+      "pinyin": "lv liang",
+      "name": "吕梁",
+      "id": 141100,
+      "fullname": "吕梁市"
+    },
+    {
+      "pinyin": "liao yang",
+      "name": "辽阳",
+      "id": 211000,
+      "fullname": "辽阳市"
+    },
+    {
+      "pinyin": "liao yuan",
+      "name": "辽源",
+      "id": 220400,
+      "fullname": "辽源市"
+    },
+    {
+      "pinyin": "lian yun gang",
+      "name": "连云港",
+      "id": 320700,
+      "fullname": "连云港市"
+    },
+    {
+      "pinyin": "li shui",
+      "name": "丽水",
+      "id": 331100,
+      "fullname": "丽水市"
+    },
+    {
+      "pinyin": "liu an",
+      "name": "六安",
+      "id": 341500,
+      "fullname": "六安市"
+    },
+    {
+      "pinyin": "long yan",
+      "name": "龙岩",
+      "id": 350800,
+      "fullname": "龙岩市"
+    },
+    {
+      "pinyin": "lin yi",
+      "name": "临沂",
+      "id": 371300,
+      "fullname": "临沂市"
+    },
+    {
+      "pinyin": "liao cheng",
+      "name": "聊城",
+      "id": 371500,
+      "fullname": "聊城市"
+    },
+    {
+      "pinyin": "luo yang",
+      "name": "洛阳",
+      "id": 410300,
+      "fullname": "洛阳市"
+    },
+    {
+      "pinyin": "luo he",
+      "name": "漯河",
+      "id": 411100,
+      "fullname": "漯河市"
+    },
+    {
+      "pinyin": "lou di",
+      "name": "娄底",
+      "id": 431300,
+      "fullname": "娄底市"
+    },
+    {
+      "pinyin": "liu zhou",
+      "name": "柳州",
+      "id": 450200,
+      "fullname": "柳州市"
+    },
+    {
+      "pinyin": "lai bin",
+      "name": "来宾",
+      "id": 451300,
+      "fullname": "来宾市"
+    },
+    {
+      "pinyin": "lin gao",
+      "name": "临高",
+      "id": 469024,
+      "fullname": "临高县"
+    },
+    {
+      "pinyin": "le dong",
+      "name": "乐东",
+      "id": 469027,
+      "fullname": "乐东黎族自治县"
+    },
+    {
+      "pinyin": "ling shui",
+      "name": "陵水",
+      "id": 469028,
+      "fullname": "陵水黎族自治县"
+    },
+    {
+      "pinyin": "lu zhou",
+      "name": "泸州",
+      "id": 510500,
+      "fullname": "泸州市"
+    },
+    {
+      "pinyin": "le shan",
+      "name": "乐山",
+      "id": 511100,
+      "fullname": "乐山市"
+    },
+    {
+      "pinyin": "liang shan",
+      "name": "凉山",
+      "id": 513400,
+      "fullname": "凉山彝族自治州"
+    },
+    {
+      "pinyin": "liu pan shui",
+      "name": "六盘水",
+      "id": 520200,
+      "fullname": "六盘水市"
+    },
+    {
+      "pinyin": "li jiang",
+      "name": "丽江",
+      "id": 530700,
+      "fullname": "丽江市"
+    },
+    {
+      "pinyin": "lin cang",
+      "name": "临沧",
+      "id": 530900,
+      "fullname": "临沧市"
+    },
+    {
+      "pinyin": "la sa",
+      "name": "拉萨",
+      "id": 540100,
+      "fullname": "拉萨市"
+    },
+    {
+      "pinyin": "lin zhi",
+      "name": "林芝",
+      "id": 540400,
+      "fullname": "林芝市"
+    },
+    {
+      "pinyin": "lan zhou",
+      "name": "兰州",
+      "id": 620100,
+      "fullname": "兰州市"
+    },
+    {
+      "pinyin": "long nan",
+      "name": "陇南",
+      "id": 621200,
+      "fullname": "陇南市"
+    },
+    {
+      "pinyin": "lin xia",
+      "name": "临夏",
+      "id": 622900,
+      "fullname": "临夏回族自治州"
+    }
+  ],
+  "M": [
+    {
+      "pinyin": "mu dan jiang",
+      "name": "牡丹江",
+      "id": 231000,
+      "fullname": "牡丹江市"
+    },
+    {
+      "pinyin": "ma an shan",
+      "name": "马鞍山",
+      "id": 340500,
+      "fullname": "马鞍山市"
+    },
+    {
+      "pinyin": "mao ming",
+      "name": "茂名",
+      "id": 440900,
+      "fullname": "茂名市"
+    },
+    {
+      "pinyin": "mei zhou",
+      "name": "梅州",
+      "id": 441400,
+      "fullname": "梅州市"
+    },
+    {
+      "pinyin": "mian yang",
+      "name": "绵阳",
+      "id": 510700,
+      "fullname": "绵阳市"
+    },
+    {
+      "pinyin": "mei shan",
+      "name": "眉山",
+      "id": 511400,
+      "fullname": "眉山市"
+    },
+    {
+      "pinyin": "miao li",
+      "name": "苗栗",
+      "id": 711500,
+      "fullname": "苗栗县"
+    }
+  ],
+  "N": [
+    {
+      "pinyin": "nan jing",
+      "name": "南京",
+      "id": 320100,
+      "fullname": "南京市"
+    },
+    {
+      "pinyin": "nan tong",
+      "name": "南通",
+      "id": 320600,
+      "fullname": "南通市"
+    },
+    {
+      "pinyin": "ning bo",
+      "name": "宁波",
+      "id": 330200,
+      "fullname": "宁波市"
+    },
+    {
+      "pinyin": "nan ping",
+      "name": "南平",
+      "id": 350700,
+      "fullname": "南平市"
+    },
+    {
+      "pinyin": "ning de",
+      "name": "宁德",
+      "id": 350900,
+      "fullname": "宁德市"
+    },
+    {
+      "pinyin": "nan chang",
+      "name": "南昌",
+      "id": 360100,
+      "fullname": "南昌市"
+    },
+    {
+      "pinyin": "nan yang",
+      "name": "南阳",
+      "id": 411300,
+      "fullname": "南阳市"
+    },
+    {
+      "pinyin": "nan ning",
+      "name": "南宁",
+      "id": 450100,
+      "fullname": "南宁市"
+    },
+    {
+      "pinyin": "nei jiang",
+      "name": "内江",
+      "id": 511000,
+      "fullname": "内江市"
+    },
+    {
+      "pinyin": "nan chong",
+      "name": "南充",
+      "id": 511300,
+      "fullname": "南充市"
+    },
+    {
+      "pinyin": "nu jiang",
+      "name": "怒江",
+      "id": 533300,
+      "fullname": "怒江傈僳族自治州"
+    },
+    {
+      "pinyin": "na qu",
+      "name": "那曲",
+      "id": 540600,
+      "fullname": "那曲市"
+    },
+    {
+      "pinyin": "nan tou",
+      "name": "南投",
+      "id": 710600,
+      "fullname": "南投县"
+    }
+  ],
+  "P": [
+    {
+      "pinyin": "pan jin",
+      "name": "盘锦",
+      "id": 211100,
+      "fullname": "盘锦市"
+    },
+    {
+      "pinyin": "pu tian",
+      "name": "莆田",
+      "id": 350300,
+      "fullname": "莆田市"
+    },
+    {
+      "pinyin": "ping xiang",
+      "name": "萍乡",
+      "id": 360300,
+      "fullname": "萍乡市"
+    },
+    {
+      "pinyin": "ping ding shan",
+      "name": "平顶山",
+      "id": 410400,
+      "fullname": "平顶山市"
+    },
+    {
+      "pinyin": "pu yang",
+      "name": "濮阳",
+      "id": 410900,
+      "fullname": "濮阳市"
+    },
+    {
+      "pinyin": "pan zhi hua",
+      "name": "攀枝花",
+      "id": 510400,
+      "fullname": "攀枝花市"
+    },
+    {
+      "pinyin": "pu er",
+      "name": "普洱",
+      "id": 530800,
+      "fullname": "普洱市"
+    },
+    {
+      "pinyin": "ping liang",
+      "name": "平凉",
+      "id": 620800,
+      "fullname": "平凉市"
+    },
+    {
+      "pinyin": "ping dong",
+      "name": "屏东",
+      "id": 712400,
+      "fullname": "屏东县"
+    },
+    {
+      "pinyin": "peng hu",
+      "name": "澎湖",
+      "id": 712700,
+      "fullname": "澎湖县"
+    }
+  ],
+  "Q": [
+    {
+      "pinyin": "qin huang dao",
+      "name": "秦皇岛",
+      "id": 130300,
+      "fullname": "秦皇岛市"
+    },
+    {
+      "pinyin": "qi qi ha er",
+      "name": "齐齐哈尔",
+      "id": 230200,
+      "fullname": "齐齐哈尔市"
+    },
+    {
+      "pinyin": "qi tai he",
+      "name": "七台河",
+      "id": 230900,
+      "fullname": "七台河市"
+    },
+    {
+      "pinyin": "qu zhou",
+      "name": "衢州",
+      "id": 330800,
+      "fullname": "衢州市"
+    },
+    {
+      "pinyin": "quan zhou",
+      "name": "泉州",
+      "id": 350500,
+      "fullname": "泉州市"
+    },
+    {
+      "pinyin": "qing dao",
+      "name": "青岛",
+      "id": 370200,
+      "fullname": "青岛市"
+    },
+    {
+      "pinyin": "qian jiang",
+      "name": "潜江",
+      "id": 429005,
+      "fullname": "潜江市"
+    },
+    {
+      "pinyin": "qing yuan",
+      "name": "清远",
+      "id": 441800,
+      "fullname": "清远市"
+    },
+    {
+      "pinyin": "qin zhou",
+      "name": "钦州",
+      "id": 450700,
+      "fullname": "钦州市"
+    },
+    {
+      "pinyin": "qiong hai",
+      "name": "琼海",
+      "id": 469002,
+      "fullname": "琼海市"
+    },
+    {
+      "pinyin": "qiong zhong",
+      "name": "琼中",
+      "id": 469030,
+      "fullname": "琼中黎族苗族自治县"
+    },
+    {
+      "pinyin": "qian xi nan",
+      "name": "黔西南",
+      "id": 522300,
+      "fullname": "黔西南布依族苗族自治州"
+    },
+    {
+      "pinyin": "qian dong nan",
+      "name": "黔东南",
+      "id": 522600,
+      "fullname": "黔东南苗族侗族自治州"
+    },
+    {
+      "pinyin": "qian nan",
+      "name": "黔南",
+      "id": 522700,
+      "fullname": "黔南布依族苗族自治州"
+    },
+    {
+      "pinyin": "qu jing",
+      "name": "曲靖",
+      "id": 530300,
+      "fullname": "曲靖市"
+    },
+    {
+      "pinyin": "qing yang",
+      "name": "庆阳",
+      "id": 621000,
+      "fullname": "庆阳市"
+    }
+  ],
+  "R": [
+    {
+      "pinyin": "ri zhao",
+      "name": "日照",
+      "id": 371100,
+      "fullname": "日照市"
+    },
+    {
+      "pinyin": "ri ka ze",
+      "name": "日喀则",
+      "id": 540200,
+      "fullname": "日喀则市"
+    }
+  ],
+  "S": [
+    {
+      "pinyin": "shi jia zhuang",
+      "name": "石家庄",
+      "id": 130100,
+      "fullname": "石家庄市"
+    },
+    {
+      "pinyin": "shuo zhou",
+      "name": "朔州",
+      "id": 140600,
+      "fullname": "朔州市"
+    },
+    {
+      "pinyin": "shen yang",
+      "name": "沈阳",
+      "id": 210100,
+      "fullname": "沈阳市"
+    },
+    {
+      "pinyin": "si ping",
+      "name": "四平",
+      "id": 220300,
+      "fullname": "四平市"
+    },
+    {
+      "pinyin": "song yuan",
+      "name": "松原",
+      "id": 220700,
+      "fullname": "松原市"
+    },
+    {
+      "pinyin": "shuang ya shan",
+      "name": "双鸭山",
+      "id": 230500,
+      "fullname": "双鸭山市"
+    },
+    {
+      "pinyin": "sui hua",
+      "name": "绥化",
+      "id": 231200,
+      "fullname": "绥化市"
+    },
+    {
+      "pinyin": "shang hai",
+      "name": "上海",
+      "id": 310000,
+      "fullname": "上海市"
+    },
+    {
+      "pinyin": "su zhou",
+      "name": "苏州",
+      "id": 320500,
+      "fullname": "苏州市"
+    },
+    {
+      "pinyin": "su qian",
+      "name": "宿迁",
+      "id": 321300,
+      "fullname": "宿迁市"
+    },
+    {
+      "pinyin": "shao xing",
+      "name": "绍兴",
+      "id": 330600,
+      "fullname": "绍兴市"
+    },
+    {
+      "pinyin": "su zhou",
+      "name": "宿州",
+      "id": 341300,
+      "fullname": "宿州市"
+    },
+    {
+      "pinyin": "san ming",
+      "name": "三明",
+      "id": 350400,
+      "fullname": "三明市"
+    },
+    {
+      "pinyin": "shang rao",
+      "name": "上饶",
+      "id": 361100,
+      "fullname": "上饶市"
+    },
+    {
+      "pinyin": "san men xia",
+      "name": "三门峡",
+      "id": 411200,
+      "fullname": "三门峡市"
+    },
+    {
+      "pinyin": "shang qiu",
+      "name": "商丘",
+      "id": 411400,
+      "fullname": "商丘市"
+    },
+    {
+      "pinyin": "shi yan",
+      "name": "十堰",
+      "id": 420300,
+      "fullname": "十堰市"
+    },
+    {
+      "pinyin": "sui zhou",
+      "name": "随州",
+      "id": 421300,
+      "fullname": "随州市"
+    },
+    {
+      "pinyin": "shen nong jia",
+      "name": "神农架",
+      "id": 429021,
+      "fullname": "神农架林区"
+    },
+    {
+      "pinyin": "shao yang",
+      "name": "邵阳",
+      "id": 430500,
+      "fullname": "邵阳市"
+    },
+    {
+      "pinyin": "shao guan",
+      "name": "韶关",
+      "id": 440200,
+      "fullname": "韶关市"
+    },
+    {
+      "pinyin": "shen zhen",
+      "name": "深圳",
+      "id": 440300,
+      "fullname": "深圳市"
+    },
+    {
+      "pinyin": "shan tou",
+      "name": "汕头",
+      "id": 440500,
+      "fullname": "汕头市"
+    },
+    {
+      "pinyin": "shan wei",
+      "name": "汕尾",
+      "id": 441500,
+      "fullname": "汕尾市"
+    },
+    {
+      "pinyin": "san ya",
+      "name": "三亚",
+      "id": 460200,
+      "fullname": "三亚市"
+    },
+    {
+      "pinyin": "san sha",
+      "name": "三沙",
+      "id": 460300,
+      "fullname": "三沙市"
+    },
+    {
+      "pinyin": "sui ning",
+      "name": "遂宁",
+      "id": 510900,
+      "fullname": "遂宁市"
+    },
+    {
+      "pinyin": "shan nan",
+      "name": "山南",
+      "id": 540500,
+      "fullname": "山南市"
+    },
+    {
+      "pinyin": "shang luo",
+      "name": "商洛",
+      "id": 611000,
+      "fullname": "商洛市"
+    },
+    {
+      "pinyin": "shi zui shan",
+      "name": "石嘴山",
+      "id": 640200,
+      "fullname": "石嘴山市"
+    },
+    {
+      "pinyin": "shi he zi",
+      "name": "石河子",
+      "id": 659001,
+      "fullname": "石河子市"
+    },
+    {
+      "pinyin": "shuang he",
+      "name": "双河",
+      "id": 659007,
+      "fullname": "双河市"
+    }
+  ],
+  "T": [
+    {
+      "pinyin": "tian jin",
+      "name": "天津",
+      "id": 120000,
+      "fullname": "天津市"
+    },
+    {
+      "pinyin": "tang shan",
+      "name": "唐山",
+      "id": 130200,
+      "fullname": "唐山市"
+    },
+    {
+      "pinyin": "tai yuan",
+      "name": "太原",
+      "id": 140100,
+      "fullname": "太原市"
+    },
+    {
+      "pinyin": "tong liao",
+      "name": "通辽",
+      "id": 150500,
+      "fullname": "通辽市"
+    },
+    {
+      "pinyin": "tie ling",
+      "name": "铁岭",
+      "id": 211200,
+      "fullname": "铁岭市"
+    },
+    {
+      "pinyin": "tong hua",
+      "name": "通化",
+      "id": 220500,
+      "fullname": "通化市"
+    },
+    {
+      "pinyin": "tai zhou",
+      "name": "泰州",
+      "id": 321200,
+      "fullname": "泰州市"
+    },
+    {
+      "pinyin": "tai zhou",
+      "name": "台州",
+      "id": 331000,
+      "fullname": "台州市"
+    },
+    {
+      "pinyin": "tong ling",
+      "name": "铜陵",
+      "id": 340700,
+      "fullname": "铜陵市"
+    },
+    {
+      "pinyin": "tai an",
+      "name": "泰安",
+      "id": 370900,
+      "fullname": "泰安市"
+    },
+    {
+      "pinyin": "tian men",
+      "name": "天门",
+      "id": 429006,
+      "fullname": "天门市"
+    },
+    {
+      "pinyin": "tun chang",
+      "name": "屯昌",
+      "id": 469022,
+      "fullname": "屯昌县"
+    },
+    {
+      "pinyin": "tong ren",
+      "name": "铜仁",
+      "id": 520600,
+      "fullname": "铜仁市"
+    },
+    {
+      "pinyin": "tong chuan",
+      "name": "铜川",
+      "id": 610200,
+      "fullname": "铜川市"
+    },
+    {
+      "pinyin": "tian shui",
+      "name": "天水",
+      "id": 620500,
+      "fullname": "天水市"
+    },
+    {
+      "pinyin": "tu lu fan",
+      "name": "吐鲁番",
+      "id": 650400,
+      "fullname": "吐鲁番市"
+    },
+    {
+      "pinyin": "ta cheng",
+      "name": "塔城",
+      "id": 654200,
+      "fullname": "塔城地区"
+    },
+    {
+      "pinyin": "tu mu shu ke",
+      "name": "图木舒克",
+      "id": 659003,
+      "fullname": "图木舒克市"
+    },
+    {
+      "pinyin": "tie men guan",
+      "name": "铁门关",
+      "id": 659006,
+      "fullname": "铁门关市"
+    },
+    {
+      "pinyin": "tai bei",
+      "name": "台北",
+      "id": 710100,
+      "fullname": "台北市"
+    },
+    {
+      "pinyin": "tai nan",
+      "name": "台南",
+      "id": 710300,
+      "fullname": "台南市"
+    },
+    {
+      "pinyin": "tai zhong",
+      "name": "台中",
+      "id": 710400,
+      "fullname": "台中市"
+    },
+    {
+      "pinyin": "tao yuan",
+      "name": "桃园",
+      "id": 711400,
+      "fullname": "桃园市"
+    },
+    {
+      "pinyin": "tai dong",
+      "name": "台东",
+      "id": 712500,
+      "fullname": "台东县"
+    }
+  ],
+  "W": [
+    {
+      "pinyin": "wu hai",
+      "name": "乌海",
+      "id": 150300,
+      "fullname": "乌海市"
+    },
+    {
+      "pinyin": "wu lan cha bu",
+      "name": "乌兰察布",
+      "id": 150900,
+      "fullname": "乌兰察布市"
+    },
+    {
+      "pinyin": "wu xi",
+      "name": "无锡",
+      "id": 320200,
+      "fullname": "无锡市"
+    },
+    {
+      "pinyin": "wen zhou",
+      "name": "温州",
+      "id": 330300,
+      "fullname": "温州市"
+    },
+    {
+      "pinyin": "wu hu",
+      "name": "芜湖",
+      "id": 340200,
+      "fullname": "芜湖市"
+    },
+    {
+      "pinyin": "wei fang",
+      "name": "潍坊",
+      "id": 370700,
+      "fullname": "潍坊市"
+    },
+    {
+      "pinyin": "wei hai",
+      "name": "威海",
+      "id": 371000,
+      "fullname": "威海市"
+    },
+    {
+      "pinyin": "wu han",
+      "name": "武汉",
+      "id": 420100,
+      "fullname": "武汉市"
+    },
+    {
+      "pinyin": "wu zhou",
+      "name": "梧州",
+      "id": 450400,
+      "fullname": "梧州市"
+    },
+    {
+      "pinyin": "wu zhi shan",
+      "name": "五指山",
+      "id": 469001,
+      "fullname": "五指山市"
+    },
+    {
+      "pinyin": "wen chang",
+      "name": "文昌",
+      "id": 469005,
+      "fullname": "文昌市"
+    },
+    {
+      "pinyin": "wan ning",
+      "name": "万宁",
+      "id": 469006,
+      "fullname": "万宁市"
+    },
+    {
+      "pinyin": "wen shan",
+      "name": "文山",
+      "id": 532600,
+      "fullname": "文山壮族苗族自治州"
+    },
+    {
+      "pinyin": "wei nan",
+      "name": "渭南",
+      "id": 610500,
+      "fullname": "渭南市"
+    },
+    {
+      "pinyin": "wu wei",
+      "name": "武威",
+      "id": 620600,
+      "fullname": "武威市"
+    },
+    {
+      "pinyin": "wu zhong",
+      "name": "吴忠",
+      "id": 640300,
+      "fullname": "吴忠市"
+    },
+    {
+      "pinyin": "wu lu mu qi",
+      "name": "乌鲁木齐",
+      "id": 650100,
+      "fullname": "乌鲁木齐市"
+    },
+    {
+      "pinyin": "wu jia qu",
+      "name": "五家渠",
+      "id": 659004,
+      "fullname": "五家渠市"
+    }
+  ],
+  "X": [
+    {
+      "pinyin": "xing tai",
+      "name": "邢台",
+      "id": 130500,
+      "fullname": "邢台市"
+    },
+    {
+      "pinyin": "xin zhou",
+      "name": "忻州",
+      "id": 140900,
+      "fullname": "忻州市"
+    },
+    {
+      "pinyin": "xing an",
+      "name": "兴安",
+      "id": 152200,
+      "fullname": "兴安盟"
+    },
+    {
+      "pinyin": "xi lin guo le",
+      "name": "锡林郭勒",
+      "id": 152500,
+      "fullname": "锡林郭勒盟"
+    },
+    {
+      "pinyin": "xu zhou",
+      "name": "徐州",
+      "id": 320300,
+      "fullname": "徐州市"
+    },
+    {
+      "pinyin": "xuan cheng",
+      "name": "宣城",
+      "id": 341800,
+      "fullname": "宣城市"
+    },
+    {
+      "pinyin": "xia men",
+      "name": "厦门",
+      "id": 350200,
+      "fullname": "厦门市"
+    },
+    {
+      "pinyin": "xin yu",
+      "name": "新余",
+      "id": 360500,
+      "fullname": "新余市"
+    },
+    {
+      "pinyin": "xin xiang",
+      "name": "新乡",
+      "id": 410700,
+      "fullname": "新乡市"
+    },
+    {
+      "pinyin": "xu chang",
+      "name": "许昌",
+      "id": 411000,
+      "fullname": "许昌市"
+    },
+    {
+      "pinyin": "xin yang",
+      "name": "信阳",
+      "id": 411500,
+      "fullname": "信阳市"
+    },
+    {
+      "pinyin": "xiang yang",
+      "name": "襄阳",
+      "id": 420600,
+      "fullname": "襄阳市"
+    },
+    {
+      "pinyin": "xiao gan",
+      "name": "孝感",
+      "id": 420900,
+      "fullname": "孝感市"
+    },
+    {
+      "pinyin": "xian ning",
+      "name": "咸宁",
+      "id": 421200,
+      "fullname": "咸宁市"
+    },
+    {
+      "pinyin": "xian tao",
+      "name": "仙桃",
+      "id": 429004,
+      "fullname": "仙桃市"
+    },
+    {
+      "pinyin": "xiang tan",
+      "name": "湘潭",
+      "id": 430300,
+      "fullname": "湘潭市"
+    },
+    {
+      "pinyin": "xiang xi",
+      "name": "湘西",
+      "id": 433100,
+      "fullname": "湘西土家族苗族自治州"
+    },
+    {
+      "pinyin": "xi shuang ban na",
+      "name": "西双版纳",
+      "id": 532800,
+      "fullname": "西双版纳傣族自治州"
+    },
+    {
+      "pinyin": "xi an",
+      "name": "西安",
+      "id": 610100,
+      "fullname": "西安市"
+    },
+    {
+      "pinyin": "xian yang",
+      "name": "咸阳",
+      "id": 610400,
+      "fullname": "咸阳市"
+    },
+    {
+      "pinyin": "xi ning",
+      "name": "西宁",
+      "id": 630100,
+      "fullname": "西宁市"
+    },
+    {
+      "pinyin": "xin zhu",
+      "name": "新竹",
+      "id": 710800,
+      "fullname": "新竹市"
+    },
+    {
+      "pinyin": "xin bei",
+      "name": "新北",
+      "id": 711100,
+      "fullname": "新北市"
+    },
+    {
+      "pinyin": "xin zhu",
+      "name": "新竹",
+      "id": 711300,
+      "fullname": "新竹县"
+    },
+    {
+      "pinyin": "xiang gang",
+      "name": "香港",
+      "id": 810000,
+      "fullname": "香港特别行政区"
+    }
+  ],
+  "Y": [
+    {
+      "pinyin": "yang quan",
+      "name": "阳泉",
+      "id": 140300,
+      "fullname": "阳泉市"
+    },
+    {
+      "pinyin": "yun cheng",
+      "name": "运城",
+      "id": 140800,
+      "fullname": "运城市"
+    },
+    {
+      "pinyin": "ying kou",
+      "name": "营口",
+      "id": 210800,
+      "fullname": "营口市"
+    },
+    {
+      "pinyin": "yan bian",
+      "name": "延边",
+      "id": 222400,
+      "fullname": "延边朝鲜族自治州"
+    },
+    {
+      "pinyin": "yi chun",
+      "name": "伊春",
+      "id": 230700,
+      "fullname": "伊春市"
+    },
+    {
+      "pinyin": "yan cheng",
+      "name": "盐城",
+      "id": 320900,
+      "fullname": "盐城市"
+    },
+    {
+      "pinyin": "yang zhou",
+      "name": "扬州",
+      "id": 321000,
+      "fullname": "扬州市"
+    },
+    {
+      "pinyin": "ying tan",
+      "name": "鹰潭",
+      "id": 360600,
+      "fullname": "鹰潭市"
+    },
+    {
+      "pinyin": "yi chun",
+      "name": "宜春",
+      "id": 360900,
+      "fullname": "宜春市"
+    },
+    {
+      "pinyin": "yan tai",
+      "name": "烟台",
+      "id": 370600,
+      "fullname": "烟台市"
+    },
+    {
+      "pinyin": "yi chang",
+      "name": "宜昌",
+      "id": 420500,
+      "fullname": "宜昌市"
+    },
+    {
+      "pinyin": "yue yang",
+      "name": "岳阳",
+      "id": 430600,
+      "fullname": "岳阳市"
+    },
+    {
+      "pinyin": "yi yang",
+      "name": "益阳",
+      "id": 430900,
+      "fullname": "益阳市"
+    },
+    {
+      "pinyin": "yong zhou",
+      "name": "永州",
+      "id": 431100,
+      "fullname": "永州市"
+    },
+    {
+      "pinyin": "yang jiang",
+      "name": "阳江",
+      "id": 441700,
+      "fullname": "阳江市"
+    },
+    {
+      "pinyin": "yun fu",
+      "name": "云浮",
+      "id": 445300,
+      "fullname": "云浮市"
+    },
+    {
+      "pinyin": "yu lin",
+      "name": "玉林",
+      "id": 450900,
+      "fullname": "玉林市"
+    },
+    {
+      "pinyin": "yi bin",
+      "name": "宜宾",
+      "id": 511500,
+      "fullname": "宜宾市"
+    },
+    {
+      "pinyin": "ya an",
+      "name": "雅安",
+      "id": 511800,
+      "fullname": "雅安市"
+    },
+    {
+      "pinyin": "yu xi",
+      "name": "玉溪",
+      "id": 530400,
+      "fullname": "玉溪市"
+    },
+    {
+      "pinyin": "yan an",
+      "name": "延安",
+      "id": 610600,
+      "fullname": "延安市"
+    },
+    {
+      "pinyin": "yu lin",
+      "name": "榆林",
+      "id": 610800,
+      "fullname": "榆林市"
+    },
+    {
+      "pinyin": "yu shu",
+      "name": "玉树",
+      "id": 632700,
+      "fullname": "玉树藏族自治州"
+    },
+    {
+      "pinyin": "yin chuan",
+      "name": "银川",
+      "id": 640100,
+      "fullname": "银川市"
+    },
+    {
+      "pinyin": "yi li",
+      "name": "伊犁",
+      "id": 654000,
+      "fullname": "伊犁哈萨克自治州"
+    },
+    {
+      "pinyin": "yi lan",
+      "name": "宜兰",
+      "id": 711200,
+      "fullname": "宜兰县"
+    },
+    {
+      "pinyin": "yun lin",
+      "name": "云林",
+      "id": 712100,
+      "fullname": "云林县"
+    }
+  ],
+  "Z": [
+    {
+      "pinyin": "zhang jia kou",
+      "name": "张家口",
+      "id": 130700,
+      "fullname": "张家口市"
+    },
+    {
+      "pinyin": "zhen jiang",
+      "name": "镇江",
+      "id": 321100,
+      "fullname": "镇江市"
+    },
+    {
+      "pinyin": "zhou shan",
+      "name": "舟山",
+      "id": 330900,
+      "fullname": "舟山市"
+    },
+    {
+      "pinyin": "zhang zhou",
+      "name": "漳州",
+      "id": 350600,
+      "fullname": "漳州市"
+    },
+    {
+      "pinyin": "zi bo",
+      "name": "淄博",
+      "id": 370300,
+      "fullname": "淄博市"
+    },
+    {
+      "pinyin": "zao zhuang",
+      "name": "枣庄",
+      "id": 370400,
+      "fullname": "枣庄市"
+    },
+    {
+      "pinyin": "zheng zhou",
+      "name": "郑州",
+      "id": 410100,
+      "fullname": "郑州市"
+    },
+    {
+      "pinyin": "zhou kou",
+      "name": "周口",
+      "id": 411600,
+      "fullname": "周口市"
+    },
+    {
+      "pinyin": "zhu ma dian",
+      "name": "驻马店",
+      "id": 411700,
+      "fullname": "驻马店市"
+    },
+    {
+      "pinyin": "zhu zhou",
+      "name": "株洲",
+      "id": 430200,
+      "fullname": "株洲市"
+    },
+    {
+      "pinyin": "zhang jia jie",
+      "name": "张家界",
+      "id": 430800,
+      "fullname": "张家界市"
+    },
+    {
+      "pinyin": "zhu hai",
+      "name": "珠海",
+      "id": 440400,
+      "fullname": "珠海市"
+    },
+    {
+      "pinyin": "zhan jiang",
+      "name": "湛江",
+      "id": 440800,
+      "fullname": "湛江市"
+    },
+    {
+      "pinyin": "zhao qing",
+      "name": "肇庆",
+      "id": 441200,
+      "fullname": "肇庆市"
+    },
+    {
+      "pinyin": "zhong shan",
+      "name": "中山",
+      "id": 442000,
+      "fullname": "中山市"
+    },
+    {
+      "pinyin": "zi gong",
+      "name": "自贡",
+      "id": 510300,
+      "fullname": "自贡市"
+    },
+    {
+      "pinyin": "zi yang",
+      "name": "资阳",
+      "id": 512000,
+      "fullname": "资阳市"
+    },
+    {
+      "pinyin": "zun yi",
+      "name": "遵义",
+      "id": 520300,
+      "fullname": "遵义市"
+    },
+    {
+      "pinyin": "zhao tong",
+      "name": "昭通",
+      "id": 530600,
+      "fullname": "昭通市"
+    },
+    {
+      "pinyin": "zhang ye",
+      "name": "张掖",
+      "id": 620700,
+      "fullname": "张掖市"
+    },
+    {
+      "pinyin": "zhong wei",
+      "name": "中卫",
+      "id": 640500,
+      "fullname": "中卫市"
+    },
+    {
+      "pinyin": "zhang hua",
+      "name": "彰化",
+      "id": 711700,
+      "fullname": "彰化县"
+    }
+  ]
+}

+ 6 - 0
pom.xml

@@ -104,6 +104,12 @@
             <version>2.8.3</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.github.kevinsawicki</groupId>
+            <artifactId>http-request</artifactId>
+            <version>6.0</version>
+        </dependency>
+
         <!--test dependency-->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 2 - 0
src/main/java/com/izouma/walkchina/WalkChinaApplication.java

@@ -2,8 +2,10 @@ package com.izouma.walkchina;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
 
 @SpringBootApplication
+@EnableJpaAuditing
 public class WalkChinaApplication {
 
     public static void main(String[] args) {

+ 13 - 0
src/main/java/com/izouma/walkchina/bean/Location.java

@@ -0,0 +1,13 @@
+package com.izouma.walkchina.bean;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class Location {
+    private Double latitude;
+    private Double longitude;
+}

+ 13 - 0
src/main/java/com/izouma/walkchina/bean/MapRegion.java

@@ -0,0 +1,13 @@
+package com.izouma.walkchina.bean;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class MapRegion {
+    private Location northeast;
+    private Location southwest;
+}

+ 1 - 1
src/main/java/com/izouma/walkchina/domain/Result.java → src/main/java/com/izouma/walkchina/bean/Result.java

@@ -1,4 +1,4 @@
-package com.izouma.walkchina.domain;
+package com.izouma.walkchina.bean;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.AllArgsConstructor;

+ 21 - 0
src/main/java/com/izouma/walkchina/bean/UserMap.java

@@ -0,0 +1,21 @@
+package com.izouma.walkchina.bean;
+
+import com.izouma.walkchina.domain.City;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class UserMap {
+    private List<Double> polyline;
+    private List<Double> progressPolyline;
+    private City         origin;
+    private City         destination;
+    private Location     current;
+}

+ 23 - 0
src/main/java/com/izouma/walkchina/bean/webservice/DirectionResponse.java

@@ -0,0 +1,23 @@
+package com.izouma.walkchina.bean.webservice;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class DirectionResponse {
+    private Integer status;
+    private String  message;
+    private Result  result;
+
+    @Data
+    @AllArgsConstructor
+    @NoArgsConstructor
+    public class Result {
+        private List<MapRoute> routes;
+    }
+}

+ 27 - 0
src/main/java/com/izouma/walkchina/bean/webservice/MapRoute.java

@@ -0,0 +1,27 @@
+package com.izouma.walkchina.bean.webservice;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class MapRoute {
+    private String mode;
+
+    private List<String> tags;
+
+    private Integer distance;
+
+    private Integer duration;
+
+    private List<Double> polyline;
+
+    private List<WayPoint> waypoints;
+
+    private List<RouteStep> steps;
+}

+ 26 - 0
src/main/java/com/izouma/walkchina/bean/webservice/RouteStep.java

@@ -0,0 +1,26 @@
+package com.izouma.walkchina.bean.webservice;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class RouteStep {
+    private String instruction;
+
+    @SerializedName("polyline_idx")
+    private List<Integer> polylineIdx;
+
+    @SerializedName("road_name")
+    private String roadName;
+
+    @SerializedName("dir_desc")
+    private String dirDesc;
+
+    private Integer distance;
+}

+ 21 - 0
src/main/java/com/izouma/walkchina/bean/webservice/WayPoint.java

@@ -0,0 +1,21 @@
+package com.izouma.walkchina.bean.webservice;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class WayPoint {
+    private String   title;
+    private Location location;
+
+    @Data
+    @AllArgsConstructor
+    @NoArgsConstructor
+    private class Location {
+        private Double lat;
+        private Double lng;
+    }
+}

+ 23 - 0
src/main/java/com/izouma/walkchina/converter/DoubleArrayConverter.java

@@ -0,0 +1,23 @@
+package com.izouma.walkchina.converter;
+
+import org.apache.commons.lang3.StringUtils;
+
+import javax.persistence.AttributeConverter;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class DoubleArrayConverter implements AttributeConverter<List<Double>, String> {
+    @Override
+    public String convertToDatabaseColumn(List<Double> doubles) {
+        return StringUtils.join(doubles, ",");
+    }
+
+    @Override
+    public List<Double> convertToEntityAttribute(String s) {
+        if (StringUtils.isNotEmpty(s)) {
+            return Arrays.stream(s.split(",")).map(Double::parseDouble).collect(Collectors.toList());
+        }
+        return null;
+    }
+}

+ 29 - 0
src/main/java/com/izouma/walkchina/converter/RouteStepConverter.java

@@ -0,0 +1,29 @@
+package com.izouma.walkchina.converter;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.izouma.walkchina.bean.webservice.RouteStep;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.persistence.AttributeConverter;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+
+public class RouteStepConverter implements AttributeConverter<List<RouteStep>, String> {
+    @Override
+    public String convertToDatabaseColumn(List<RouteStep> routeSteps) {
+        return routeSteps != null ? new Gson().toJson(routeSteps) : null;
+    }
+
+    @Override
+    public List<RouteStep> convertToEntityAttribute(String s) {
+        if (StringUtils.isEmpty(s)) {
+            return null;
+        }
+        Gson gson = new Gson();
+        Type listType = new TypeToken<ArrayList<RouteStep>>() {
+        }.getType();
+        return gson.fromJson(s, listType);
+    }
+}

+ 32 - 0
src/main/java/com/izouma/walkchina/domain/BaseEntity.java

@@ -0,0 +1,32 @@
+package com.izouma.walkchina.domain;
+
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.data.annotation.CreatedBy;
+import org.springframework.data.annotation.CreatedDate;
+import org.springframework.data.annotation.LastModifiedBy;
+import org.springframework.data.annotation.LastModifiedDate;
+import org.springframework.data.jpa.domain.support.AuditingEntityListener;
+
+import javax.persistence.EntityListeners;
+import javax.persistence.MappedSuperclass;
+import java.util.Date;
+
+@Getter(AccessLevel.PUBLIC)
+@Setter(AccessLevel.PUBLIC)
+@MappedSuperclass
+@EntityListeners(AuditingEntityListener.class)
+class BaseEntity {
+    @CreatedBy
+    private String createdBy;
+
+    @CreatedDate
+    private Date createdAt;
+
+    @LastModifiedBy
+    private String modifiedBy;
+
+    @LastModifiedDate
+    private Date modifiedAt;
+}

+ 31 - 0
src/main/java/com/izouma/walkchina/domain/City.java

@@ -0,0 +1,31 @@
+package com.izouma.walkchina.domain;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.*;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class City extends BaseEntity {
+    @Id
+    private Long id;
+
+    private Long provinceId;
+
+    private String name;
+
+    private String fullname;
+
+    private String pinyin;
+
+    private Double latitude;
+
+    private Double longitude;
+}

+ 57 - 0
src/main/java/com/izouma/walkchina/domain/JourneyStage.java

@@ -0,0 +1,57 @@
+package com.izouma.walkchina.domain;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.izouma.walkchina.bean.webservice.RouteStep;
+import com.izouma.walkchina.converter.DoubleArrayConverter;
+import com.izouma.walkchina.converter.RouteStepConverter;
+import lombok.*;
+import org.hibernate.annotations.Where;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.List;
+
+@Entity
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Where(clause = "active = 1")
+public class JourneyStage extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 3520261464947638374L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private Long id;
+
+    private Long userId;
+
+    private Long origin;
+
+    private Long destination;
+
+    @Lob
+    @Column(length = 100000)
+    @Convert(converter = DoubleArrayConverter.class)
+    private List<Double> polyline;
+
+    private Integer distance;
+
+    private Long steps;
+
+    @Lob
+    @Column(length = 100000)
+    @Convert(converter = RouteStepConverter.class)
+    private List<RouteStep> routeSteps;
+
+    private Double progress;
+
+    private Long journeyId;
+
+    @Column(columnDefinition = "bit default 1", nullable = false)
+    @Builder.Default
+    public Boolean active = true;
+}

+ 29 - 0
src/main/java/com/izouma/walkchina/domain/Province.java

@@ -0,0 +1,29 @@
+package com.izouma.walkchina.domain;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.*;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Province extends BaseEntity {
+    @Id
+    private Long id;
+
+    private String name;
+
+    private String fullname;
+
+    private String pinyin;
+
+    private Double latitude;
+
+    private Double longitude;
+}

+ 8 - 20
src/main/java/com/izouma/walkchina/domain/UserInfo.java

@@ -2,37 +2,32 @@ package com.izouma.walkchina.domain;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import lombok.*;
 import org.hibernate.annotations.Where;
-import org.springframework.data.annotation.CreatedDate;
-import org.springframework.data.annotation.LastModifiedDate;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
 
 import javax.persistence.*;
 import javax.validation.constraints.Email;
-import javax.validation.constraints.NotNull;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
 
-@Data
 @Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
 @Where(clause = "active = 1")
-public class UserInfo implements UserDetails {
+public class UserInfo extends BaseEntity implements UserDetails {
 
     private static final long serialVersionUID = 6392705780780532944L;
 
     @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @GeneratedValue(strategy = GenerationType.AUTO)
     private Long id;
 
     @Column(unique = true)
@@ -41,7 +36,6 @@ public class UserInfo implements UserDetails {
     private String nickname;
 
     @JsonIgnore
-    @NotNull
     private String password;
 
     private String openId;
@@ -66,15 +60,9 @@ public class UserInfo implements UserDetails {
     @Column(columnDefinition = "integer default 0")
     private Integer sex;
 
-    @CreatedDate
-    private Date createdAt;
-
-    @LastModifiedDate
-    private Date modifiedAt;
-
     @Column(columnDefinition = "bit default 1", nullable = false)
     @Builder.Default
-    private Boolean active = true;
+    public Boolean active = true;
 
     @JsonInclude
     @Transient
@@ -111,6 +99,6 @@ public class UserInfo implements UserDetails {
     @Override
     @JsonIgnore
     public boolean isEnabled() {
-        return active;
+        return getActive();
     }
 }

+ 41 - 0
src/main/java/com/izouma/walkchina/domain/UserJourney.java

@@ -0,0 +1,41 @@
+package com.izouma.walkchina.domain;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.izouma.walkchina.converter.DoubleArrayConverter;
+import lombok.*;
+import org.hibernate.annotations.Where;
+
+import javax.persistence.*;
+import java.util.List;
+
+@Entity
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Where(clause = "active = 1")
+public class UserJourney extends BaseEntity {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private Long id;
+
+    private Long userId;
+
+    private Long origin;
+
+    private Long destination;
+
+    @Lob
+    @Column(length = 100000)
+    @Convert(converter = DoubleArrayConverter.class)
+    private List<Double> polyline;
+
+    private Integer distance;
+
+    @Column(columnDefinition = "bit default 1", nullable = false)
+    @Builder.Default
+    public Boolean active = true;
+}

+ 1 - 1
src/main/java/com/izouma/walkchina/exception/GlobalExceptionHandler.java

@@ -1,6 +1,6 @@
 package com.izouma.walkchina.exception;
 
-import com.izouma.walkchina.domain.Result;
+import com.izouma.walkchina.bean.Result;
 import org.springframework.web.bind.annotation.ControllerAdvice;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseBody;

+ 8 - 0
src/main/java/com/izouma/walkchina/repo/CityRepository.java

@@ -0,0 +1,8 @@
+package com.izouma.walkchina.repo;
+
+import com.izouma.walkchina.domain.City;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+public interface CityRepository extends JpaRepository<City, Long>, JpaSpecificationExecutor<City> {
+}

+ 10 - 0
src/main/java/com/izouma/walkchina/repo/JourneyStageRepository.java

@@ -0,0 +1,10 @@
+package com.izouma.walkchina.repo;
+
+import com.izouma.walkchina.domain.JourneyStage;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface JourneyStageRepository extends JpaRepository<JourneyStage, Long> {
+    List<JourneyStage> findAllByJourneyIdOrderById(Long journeyId);
+}

+ 7 - 0
src/main/java/com/izouma/walkchina/repo/ProvinceRepository.java

@@ -0,0 +1,7 @@
+package com.izouma.walkchina.repo;
+
+import com.izouma.walkchina.domain.Province;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface ProvinceRepository extends JpaRepository<Province, Long> {
+}

+ 8 - 0
src/main/java/com/izouma/walkchina/repo/UserJourneyRepository.java

@@ -0,0 +1,8 @@
+package com.izouma.walkchina.repo;
+
+import com.izouma.walkchina.domain.UserJourney;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface UserJourneyRepository extends JpaRepository<UserJourney, Long> {
+    UserJourney findByUserId(Long userId);
+}

+ 8 - 0
src/main/java/com/izouma/walkchina/service/JourneyService.java

@@ -0,0 +1,8 @@
+package com.izouma.walkchina.service;
+
+import org.springframework.stereotype.Service;
+
+@Service
+public class JourneyService {
+
+}

+ 116 - 0
src/main/java/com/izouma/walkchina/service/MapService.java

@@ -0,0 +1,116 @@
+package com.izouma.walkchina.service;
+
+import com.github.kevinsawicki.http.HttpRequest;
+import com.google.gson.Gson;
+import com.izouma.walkchina.bean.Location;
+import com.izouma.walkchina.bean.MapRegion;
+import com.izouma.walkchina.bean.UserMap;
+import com.izouma.walkchina.bean.webservice.DirectionResponse;
+import com.izouma.walkchina.bean.webservice.RouteStep;
+import com.izouma.walkchina.domain.City;
+import com.izouma.walkchina.domain.JourneyStage;
+import com.izouma.walkchina.domain.UserJourney;
+import com.izouma.walkchina.exception.ServiceException;
+import com.izouma.walkchina.repo.CityRepository;
+import com.izouma.walkchina.repo.JourneyStageRepository;
+import com.izouma.walkchina.repo.UserJourneyRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@Slf4j
+public class MapService {
+    @Autowired
+    private CityRepository         cityRepository;
+    @Autowired
+    private UserJourneyRepository  userJourneyRepository;
+    @Autowired
+    private JourneyStageRepository journeyStageRepository;
+
+    public List<City> citiesInRegion(MapRegion mapRegion) {
+        Specification<City> specification = (Specification<City>) (root, criteriaQuery, criteriaBuilder) -> {
+            return criteriaBuilder.and(criteriaBuilder.between(root.get("longitude"),
+                    mapRegion.getSouthwest().getLongitude(),
+                    mapRegion.getNortheast().getLongitude()),
+                    criteriaBuilder.between(root.get("latitude"),
+                            mapRegion.getSouthwest().getLatitude(),
+                            mapRegion.getNortheast().getLatitude()));
+        };
+        return cityRepository.findAll(specification);
+    }
+
+    public DirectionResponse direction(Location from, Location to) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("from", from.getLatitude() + "," + from.getLongitude());
+        params.put("to", to.getLatitude() + "," + to.getLongitude());
+        params.put("key", "YO4BZ-G75L5-CWJIV-QDPOY-77OIH-LGFMT");
+        String body = HttpRequest.get("https://apis.map.qq.com/ws/direction/v1/walking/", params, false).body();
+        Gson gson = new Gson();
+        DirectionResponse response = gson.fromJson(body, DirectionResponse.class);
+        // List<Double> polyline = response.getResult().getRoutes().get(0).getPolyline();
+        // for (int i = 2; i < polyline.size(); i++) {
+        //     polyline.set(i, BigDecimal.valueOf(polyline.get(i - 2) + polyline.get(i) / 1000000).setScale(6, BigDecimal.ROUND_HALF_UP).doubleValue());
+        // }
+        return response;
+    }
+
+    public UserMap userMap(Long userId) {
+        UserJourney userJourney = userJourneyRepository.findByUserId(userId);
+        if (userJourney == null) {
+            throw new ServiceException("无记录");
+        }
+        City origin = cityRepository.findById(userJourney.getOrigin()).orElse(null);
+        if (origin == null) {
+            throw new ServiceException("无记录");
+        }
+        City destination = cityRepository.findById(userJourney.getDestination()).orElse(null);
+        if (destination == null) {
+            throw new ServiceException("无记录");
+        }
+        UserMap userMap = UserMap.builder()
+                .polyline(userJourney.getPolyline())
+                .origin(origin)
+                .destination(destination)
+                .build();
+        List<Double> progressPolyline = new ArrayList<>();
+        List<JourneyStage> stages = journeyStageRepository.findAllByJourneyIdOrderById(userJourney.getId());
+        for (int i = 0; i < stages.size() - 1; i++) {
+            progressPolyline.addAll(stages.get(i).getPolyline());
+        }
+        JourneyStage latestStage = stages.get(stages.size() - 1);
+        List<RouteStep> steps = latestStage.getRouteSteps();
+        int distance = 0;
+        for (RouteStep step : steps) {
+            distance += step.getDistance();
+            if (distance < latestStage.getDistance() * latestStage.getProgress()) {
+                for (int j = step.getPolylineIdx().get(0); j <= step.getPolylineIdx().get(1); j++) {
+                    progressPolyline.add(latestStage.getPolyline().get(j));
+                }
+            } else {
+                double p = 1 - (distance - (latestStage.getDistance() * latestStage.getProgress())) / (double) step.getDistance();
+                int start = step.getPolylineIdx().get(0);
+                int end = start + (int) ((step.getPolylineIdx().get(1) - step.getPolylineIdx().get(0)) * p);
+                end = end + (end % 2 == 0 ? 1 : 0);
+                if (end < start + 1) {
+                    end = start + 1;
+                }
+                if (end > step.getPolylineIdx().get(1)) {
+                    end = step.getPolylineIdx().get(1);
+                }
+                for (int j = start; j <= end; j++) {
+                    progressPolyline.add(latestStage.getPolyline().get(j));
+                }
+                break;
+            }
+        }
+        userMap.setProgressPolyline(progressPolyline);
+        return userMap;
+    }
+}

+ 4 - 2
src/main/java/com/izouma/walkchina/service/UserInfoService.java

@@ -17,6 +17,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.UUID;
 
 
@@ -58,6 +59,7 @@ public class UserInfoService implements UserDetailsService {
             String sessionKey = result.getSessionKey();
             UserInfo userInfo = userInfoRepository.findByOpenId(openId).orElse(null);
             if (userInfo != null) {
+                userInfo.setSessionKey(sessionKey);
                 return userInfo;
             }
             userInfo = UserInfo.builder()
@@ -77,7 +79,7 @@ public class UserInfoService implements UserDetailsService {
     }
 
     public UserInfo getMiniAppUserInfo(String sessionKey, String rawData, String signature,
-                                  String encryptedData, String iv) {
+                                       String encryptedData, String iv) {
         // 用户信息校验
         if (!wxMaService.getUserService().checkUserInfo(sessionKey, rawData, signature)) {
             throw new ServiceException("获取用户信息失败");
@@ -89,7 +91,7 @@ public class UserInfoService implements UserDetailsService {
 
         String avatarUrl = "https://microball.oss-cn-hangzhou.aliyuncs.com/awesomeAdmin/user.png";
         try {
-            String path = "image/avatar/" + new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss") + RandomStringUtils.randomAlphabetic(8) + ".jpg";
+            String path = "image/avatar/" + new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date()) + RandomStringUtils.randomAlphabetic(8) + ".jpg";
             avatarUrl = storageService.uploadFromUrl(wxUserInfo.getAvatarUrl(), path);
         } catch (Exception e) {
             log.error("获取头像失败", e);

+ 13 - 1
src/main/java/com/izouma/walkchina/web/AuthenticationController.java

@@ -1,6 +1,6 @@
 package com.izouma.walkchina.web;
 
-import com.izouma.walkchina.domain.Result;
+import com.izouma.walkchina.bean.Result;
 import com.izouma.walkchina.domain.UserInfo;
 import com.izouma.walkchina.exception.ServiceException;
 import com.izouma.walkchina.security.JwtTokenUtil;
@@ -55,4 +55,16 @@ public class AuthenticationController {
         UserInfo userInfo = userInfoService.registerByUserPwd(username, password);
         return ResponseEntity.ok(Result.ok(userInfo));
     }
+
+    @PostMapping("/loginMiniApp")
+    public Result loginMiniApp(@RequestParam("code") String code) {
+        UserInfo userInfo = userInfoService.loginMiniApp(code);
+        if (userInfo != null) {
+            final UserDetails userDetails = userInfoService.loadUserByUsername(userInfo.getUsername());
+            final String token = jwtTokenUtil.generateToken(userDetails);
+            userInfo.setToken(token);
+            return Result.ok(userInfo);
+        }
+        return Result.error("登录失败,请稍后再试");
+    }
 }

+ 1 - 1
src/main/java/com/izouma/walkchina/web/FileUploadController.java

@@ -1,6 +1,6 @@
 package com.izouma.walkchina.web;
 
-import com.izouma.walkchina.domain.Result;
+import com.izouma.walkchina.bean.Result;
 import com.izouma.walkchina.service.storage.StorageService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FilenameUtils;

+ 24 - 0
src/main/java/com/izouma/walkchina/web/MapController.java

@@ -0,0 +1,24 @@
+package com.izouma.walkchina.web;
+
+import com.izouma.walkchina.bean.MapRegion;
+import com.izouma.walkchina.bean.Result;
+import com.izouma.walkchina.service.MapService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/map")
+public class MapController {
+    @Autowired
+    private MapService mapService;
+
+    @PostMapping("/citiesInRegion")
+    public Result citiesInRegion(@RequestBody MapRegion mapRegion) {
+        return Result.ok(mapService.citiesInRegion(mapRegion));
+    }
+
+    @GetMapping("/userMap")
+    public Result userMap() {
+        return Result.ok(mapService.userMap(3L));
+    }
+}

+ 1 - 10
src/main/java/com/izouma/walkchina/web/UserInfoController.java

@@ -1,6 +1,6 @@
 package com.izouma.walkchina.web;
 
-import com.izouma.walkchina.domain.Result;
+import com.izouma.walkchina.bean.Result;
 import com.izouma.walkchina.domain.UserInfo;
 import com.izouma.walkchina.repo.UserInfoRepository;
 import com.izouma.walkchina.service.UserInfoService;
@@ -63,15 +63,6 @@ public class UserInfoController {
         return Result.ok(userInfoRepository.findAll(Example.of(probe), PageRequest.of(page, size)));
     }
 
-    @PostMapping("/loginMiniApp")
-    public Result loginMiniApp(String code) {
-        UserInfo userInfo = userInfoService.loginMiniApp(code);
-        if (userInfo != null) {
-            return Result.ok(userInfo);
-        }
-        return Result.error("登录失败,请稍后再试");
-    }
-
     @PostMapping("/getMiniAppUserInfo")
     public Result getMiniAppUserInfo(String sessionKey, String rawData, String signature,
                                      String encryptedData, String iv) {

+ 1 - 1
src/main/resources/application.yaml

@@ -40,7 +40,7 @@ wx:
     msg_aes_key: aesKey
     msg_format: JSON
 storage:
-  provider: local
+  provider: aliyun
   local_path: /var/www/upload/
 aliyun:
   access_key_id: PXzJyah5rZfWHIIH

+ 106 - 0
src/test/java/com/izouma/walkchina/repo/CityRepositoryTest.java

@@ -0,0 +1,106 @@
+package com.izouma.walkchina.repo;
+
+import com.github.kevinsawicki.http.HttpRequest;
+import com.google.gson.Gson;
+import com.izouma.walkchina.domain.City;
+import com.izouma.walkchina.domain.Province;
+import org.apache.commons.lang3.StringUtils;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.*;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class CityRepositoryTest {
+    @Autowired
+    private CityRepository     cityRepository;
+    @Autowired
+    private ProvinceRepository provinceRepository;
+
+    @Test
+    public void getCity() throws JSONException {
+        List<String> municipalities = Arrays.asList("北京", "上海", "天津", "重庆", "香港", "澳门");
+        for (Province province : provinceRepository.findAll()) {
+            if (municipalities.indexOf(province.getName()) != -1) {
+                City city = City.builder().
+                        id(province.getId())
+                        .name(province.getName())
+                        .fullname(province.getFullname())
+                        .latitude(province.getLatitude())
+                        .longitude(province.getLongitude())
+                        .pinyin(province.getPinyin())
+                        .build();
+                cityRepository.save(city);
+            } else {
+                Map<String, String> params = new HashMap<>();
+                params.put("key", "YO4BZ-G75L5-CWJIV-QDPOY-77OIH-LGFMT");
+                params.put("id", province.getId().toString());
+                String body = HttpRequest.get("https://apis.map.qq.com/ws/district/v1/getchildren", params, false).body();
+                JSONArray jsonArray = new JSONObject(body).getJSONArray("result").getJSONArray(0);
+                System.out.println(body);
+                for (int i = 0; i < jsonArray.length(); i++) {
+                    JSONObject jsonObject = jsonArray.getJSONObject(i);
+                    City city = City.builder()
+                            .id(jsonObject.getLong("id"))
+                            .name(jsonObject.getString("name"))
+                            .fullname(jsonObject.getString("fullname"))
+                            .pinyin(getPinyin(jsonObject.getJSONArray("pinyin")))
+                            .latitude(jsonObject.getJSONObject("location").getDouble("lat"))
+                            .longitude(jsonObject.getJSONObject("location").getDouble("lng"))
+                            .build();
+                    cityRepository.save(city);
+                }
+            }
+        }
+    }
+
+    @Test
+    public void export() throws IOException {
+        Map<String, List<Map>> map = new HashMap<>();
+        for (City city : cityRepository.findAll(new Specification<City>() {
+            @Override
+            public Predicate toPredicate(Root<City> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
+                return null;
+            }
+        })) {
+            map.putIfAbsent(city.getPinyin().substring(0, 1).toUpperCase(), new ArrayList<>());
+            List<Map> list = map.get(city.getPinyin().substring(0, 1).toUpperCase());
+            Map<String, Object> item = new HashMap<>();
+            item.put("id", city.getId());
+            item.put("name", city.getName());
+            item.put("fullname", city.getFullname());
+            item.put("pinyin", city.getPinyin());
+            list.add(item);
+        }
+        Gson gson = new Gson();
+        gson.toJson(map);
+        File file = new File("city.json");
+        FileWriter fileWriter = new FileWriter(file);
+        fileWriter.write(gson.toJson(map));
+        fileWriter.flush();
+        fileWriter.close();
+    }
+
+    String getPinyin(JSONArray jsonArray) throws JSONException {
+        List<String> strings = new ArrayList<>();
+        for (int i = 0; i < jsonArray.length(); i++) {
+            strings.add(jsonArray.getString(i));
+        }
+        return StringUtils.join(strings, " ");
+    }
+}

+ 57 - 0
src/test/java/com/izouma/walkchina/repo/ProvinceRepositoryTest.java

@@ -0,0 +1,57 @@
+package com.izouma.walkchina.repo;
+
+import com.github.kevinsawicki.http.HttpRequest;
+import com.izouma.walkchina.domain.Province;
+import org.apache.commons.lang3.StringUtils;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class ProvinceRepositoryTest {
+    @Autowired
+    private ProvinceRepository provinceRepository;
+
+    @Test
+    public void addProvince() throws JSONException {
+        Map<String, String> params = new HashMap<>();
+        params.put("key", "YO4BZ-G75L5-CWJIV-QDPOY-77OIH-LGFMT");
+
+        String body = HttpRequest.get("https://apis.map.qq.com/ws/district/v1/list", params, false).body();
+        JSONArray jsonArray = new JSONObject(body).getJSONArray("result").getJSONArray(0);
+        for (int i = 0; i < jsonArray.length(); i++) {
+            JSONObject jsonObject = jsonArray.getJSONObject(i);
+            Province province = Province.builder()
+                    .id(jsonObject.getLong("id"))
+                    .name(jsonObject.getString("name"))
+                    .fullname(jsonObject.getString("fullname"))
+                    .pinyin(getPinyin(jsonObject.getJSONArray("pinyin")))
+                    .latitude(jsonObject.getJSONObject("location").getDouble("lat"))
+                    .longitude(jsonObject.getJSONObject("location").getDouble("lng"))
+                    .build();
+            provinceRepository.save(province);
+        }
+        System.out.println(body);
+    }
+
+    String getPinyin(JSONArray jsonArray) throws JSONException {
+        List<String> strings = new ArrayList<>();
+        for (int i = 0; i < jsonArray.length(); i++) {
+            strings.add(jsonArray.getString(i));
+        }
+        return StringUtils.join(strings, " ");
+    }
+}

+ 65 - 0
src/test/java/com/izouma/walkchina/service/MapServiceTest.java

@@ -0,0 +1,65 @@
+package com.izouma.walkchina.service;
+
+import com.google.gson.Gson;
+import com.izouma.walkchina.bean.Location;
+import com.izouma.walkchina.bean.webservice.DirectionResponse;
+import com.izouma.walkchina.domain.City;
+import com.izouma.walkchina.domain.JourneyStage;
+import com.izouma.walkchina.domain.UserJourney;
+import com.izouma.walkchina.repo.CityRepository;
+import com.izouma.walkchina.repo.JourneyStageRepository;
+import com.izouma.walkchina.repo.UserJourneyRepository;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.data.domain.Example;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class MapServiceTest {
+    @Autowired
+    private MapService             mapService;
+    @Autowired
+    private JourneyStageRepository journeyStageRepository;
+    @Autowired
+    private UserJourneyRepository  userJourneyRepository;
+    @Autowired
+    private CityRepository         cityRepository;
+
+    @Test
+    public void citiesInRegion() {
+    }
+
+    @Test
+    public void direction() {
+
+        City from = cityRepository.findOne(Example.of(City.builder().name("南京").build())).orElse(null);
+        City to = cityRepository.findOne(Example.of(City.builder().name("扬州 ").build())).orElse(null);
+        DirectionResponse response = mapService.direction(new Location(from.getLatitude(), from.getLongitude()),
+                new Location(to.getLatitude(), to.getLongitude()));
+        System.out.println(new Gson().toJson(response));
+
+        UserJourney userJourney = UserJourney.builder()
+                .userId(3L)
+                .origin(from.getId())
+                .destination(to.getId())
+                .distance(response.getResult().getRoutes().get(0).getDistance())
+                .polyline(response.getResult().getRoutes().get(0).getPolyline())
+                .build();
+        userJourney = userJourneyRepository.save(userJourney);
+        JourneyStage journeyStage = JourneyStage.builder()
+                .userId(3L)
+                .journeyId(userJourney.getId())
+                .origin(from.getId())
+                .destination(to.getId())
+                .polyline(response.getResult().getRoutes().get(0).getPolyline())
+                .routeSteps(response.getResult().getRoutes().get(0).getSteps())
+                .distance(response.getResult().getRoutes().get(0).getDistance())
+                .progress(.4)
+                .build();
+        journeyStage = journeyStageRepository.save(journeyStage);
+
+    }
+}

+ 27 - 0
src/test/java/com/izouma/walkchina/service/UserInfoServiceTest.java

@@ -0,0 +1,27 @@
+package com.izouma.walkchina.service;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class UserInfoServiceTest {
+
+    @Test
+    public void loadUserByUsername() {
+    }
+
+    @Test
+    public void registerByUserPwd() {
+    }
+
+    @Test
+    public void loginMiniApp() {
+    }
+
+    @Test
+    public void getMiniAppUserInfo() {
+    }
+}

+ 15 - 0
src/test/java/com/izouma/walkchina/web/UserInfoControllerTest.java

@@ -0,0 +1,15 @@
+package com.izouma.walkchina.web;
+
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import static org.junit.Assert.*;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@AutoConfigureMockMvc
+public class UserInfoControllerTest {
+
+}