优化
This commit is contained in:
parent
958bcd5f75
commit
fb83c51556
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
39
src/main/java/com/xkrs/model/bean/RegionBean.java
Normal file
39
src/main/java/com/xkrs/model/bean/RegionBean.java
Normal file
@ -0,0 +1,39 @@
|
||||
package com.xkrs.model.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RegionBean {
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
private List<RegionBean> 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<RegionBean> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<RegionBean> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
@ -30,4 +30,6 @@ public interface StreetService {
|
||||
List<Map<String, String>> selectCountyList(String cityCode);
|
||||
|
||||
List<Map<String, String>> selectStreetList(String countyCode);
|
||||
|
||||
String getAllRegionList();
|
||||
}
|
||||
|
@ -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<Map<String, String>> selectStreetList(String countyCode) {
|
||||
return streetDao.selectStreetList(countyCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAllRegionList() {
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user