From fb83c51556903a114f1543b945ddd122dbc9ddc1 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 7 Mar 2023 21:06:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/controller/StreetController.java | 9 +++++ .../java/com/xkrs/model/bean/RegionBean.java | 39 +++++++++++++++++++ .../java/com/xkrs/service/StreetService.java | 2 + .../xkrs/service/impl/StreetServiceImpl.java | 11 ++++++ 4 files changed, 61 insertions(+) create mode 100644 src/main/java/com/xkrs/model/bean/RegionBean.java diff --git a/src/main/java/com/xkrs/controller/StreetController.java b/src/main/java/com/xkrs/controller/StreetController.java index 88296bd..5985268 100644 --- a/src/main/java/com/xkrs/controller/StreetController.java +++ b/src/main/java/com/xkrs/controller/StreetController.java @@ -2,6 +2,7 @@ package com.xkrs.controller; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.dao.StreetDao; +import com.xkrs.service.StreetService; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -20,6 +21,9 @@ public class StreetController { @Resource private StreetDao streetDao; + @Resource + private StreetService streetService; + /** * 获取省列表 */ @@ -73,4 +77,9 @@ public class StreetController { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, streetList, locale); } + @GetMapping("/getAllRegionList") + public String getAllRegionList() { + return streetService.getAllRegionList(); + } + } diff --git a/src/main/java/com/xkrs/model/bean/RegionBean.java b/src/main/java/com/xkrs/model/bean/RegionBean.java new file mode 100644 index 0000000..a52204d --- /dev/null +++ b/src/main/java/com/xkrs/model/bean/RegionBean.java @@ -0,0 +1,39 @@ +package com.xkrs.model.bean; + +import java.util.List; + +public class RegionBean { + + private String code; + + private String name; + + private List children; + + public RegionBean() { + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/src/main/java/com/xkrs/service/StreetService.java b/src/main/java/com/xkrs/service/StreetService.java index c676dfa..066c6cc 100644 --- a/src/main/java/com/xkrs/service/StreetService.java +++ b/src/main/java/com/xkrs/service/StreetService.java @@ -30,4 +30,6 @@ public interface StreetService { List> selectCountyList(String cityCode); List> selectStreetList(String countyCode); + + String getAllRegionList(); } diff --git a/src/main/java/com/xkrs/service/impl/StreetServiceImpl.java b/src/main/java/com/xkrs/service/impl/StreetServiceImpl.java index a410194..801e05a 100644 --- a/src/main/java/com/xkrs/service/impl/StreetServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/StreetServiceImpl.java @@ -3,15 +3,19 @@ package com.xkrs.service.impl; import com.xkrs.dao.StreetDao; import com.xkrs.model.entity.StreetEntity; import com.xkrs.service.StreetService; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; +import java.util.Locale; import java.util.Map; @Service public class StreetServiceImpl implements StreetService { + private final Locale locale = LocaleContextHolder.getLocale(); + @Resource private StreetDao streetDao; @@ -74,4 +78,11 @@ public class StreetServiceImpl implements StreetService { public List> selectStreetList(String countyCode) { return streetDao.selectStreetList(countyCode); } + + @Override + public String getAllRegionList() { + + + return null; + } }