|
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -35,9 +36,12 @@ public class AreaApiService implements AreaApi {
|
|
|
BeanUtils.copyProperties(o, areaInfo);
|
|
|
return areaInfo;
|
|
|
}).collect(Collectors.toList());
|
|
|
- List<AreaInfo> areaInfos = buildData(collect, list);
|
|
|
- // 构建树
|
|
|
- return buildTree(areaInfos, list);
|
|
|
+ for (AreaInfo areaInfo : collect) {
|
|
|
+ List<AreaInfo> areaInfos = buildData(Arrays.asList(areaInfo), list);
|
|
|
+ // 构建树
|
|
|
+ areaInfo.setDistricts(buildTree(areaInfos, list));
|
|
|
+ }
|
|
|
+ return collect;
|
|
|
}
|
|
|
return new ArrayList<>();
|
|
|
// return GaoDeWebUtil.getInfoLikeKeywordsAndSubdistrict(keywords, subdistrict);
|