Commit 932f1bde85485d769c4d10c3d76972d079fd74ae
1 parent
e75e4ca5
update...
Showing
2 changed files
with
19 additions
and
0 deletions
src/main/java/com/bsth/server_rs/base_info/section/LD_SectionRestService.java
| ... | ... | @@ -30,4 +30,11 @@ public class LD_SectionRestService { |
| 30 | 30 | public Map<String, Collection<LD_SectionRoute>> findByCompany(@PathParam("company") String company){ |
| 31 | 31 | return sectionBufferData.findRouteByCompany(company); |
| 32 | 32 | } |
| 33 | + | |
| 34 | + | |
| 35 | + @GET | |
| 36 | + @Path("/line/{lineCode}") | |
| 37 | + public Map<String, Collection<LD_SectionRoute>> findByLineCode(@PathParam("lineCode") String lineCode){ | |
| 38 | + return sectionBufferData.findByLineCode(lineCode); | |
| 39 | + } | |
| 33 | 40 | } | ... | ... |
src/main/java/com/bsth/server_rs/base_info/section/buffer/LD_SectionBufferData.java
| ... | ... | @@ -123,4 +123,16 @@ public class LD_SectionBufferData implements CommandLineRunner { |
| 123 | 123 | public List<RoadSpeed> roadSpeedList(String company) { |
| 124 | 124 | return roadSpeedList; |
| 125 | 125 | } |
| 126 | + | |
| 127 | + public Map<String, Collection<LD_SectionRoute>> findByLineCode(String lineCode) { | |
| 128 | + | |
| 129 | + ArrayListMultimap<String, LD_SectionRoute> listMap = ArrayListMultimap.create(); | |
| 130 | + | |
| 131 | + String k1 = lineCode + "_0"; | |
| 132 | + String k2 = lineCode + "_1"; | |
| 133 | + | |
| 134 | + listMap.putAll(k1, routeListMap.get(k1)); | |
| 135 | + listMap.putAll(k2, routeListMap.get(k2)); | |
| 136 | + return listMap.asMap(); | |
| 137 | + } | |
| 126 | 138 | } | ... | ... |