Commit 2ca4c2e8a3e67df16b7c719cb777d52ca79b9aae
1 parent
e1fde469
update...
Showing
2 changed files
with
17 additions
and
0 deletions
src/main/java/com/bsth/server_rs/base_info/station/StationRestService.java
| ... | ... | @@ -25,4 +25,10 @@ public class StationRestService { |
| 25 | 25 | public Map<String, Collection<StationRotue>> findByCompany(@PathParam("company") String company){ |
| 26 | 26 | return StationBufferData.findRouteByCompany(company); |
| 27 | 27 | } |
| 28 | + | |
| 29 | + @GET | |
| 30 | + @Path("/{lineCode}") | |
| 31 | + public Map<String, Collection<StationRotue>> findByLineCode(@PathParam("lineCode") String lineCode){ | |
| 32 | + return StationBufferData.findRouteByLineCode(lineCode); | |
| 33 | + } | |
| 28 | 34 | } | ... | ... |
src/main/java/com/bsth/server_rs/base_info/station/buffer/StationBufferData.java
| ... | ... | @@ -102,4 +102,15 @@ public class StationBufferData implements CommandLineRunner { |
| 102 | 102 | } |
| 103 | 103 | return false; |
| 104 | 104 | } |
| 105 | + | |
| 106 | + public static Map<String, Collection<StationRotue>> findRouteByLineCode(String lineCode){ | |
| 107 | + | |
| 108 | + ArrayListMultimap<String, StationRotue> listMap = ArrayListMultimap.create(); | |
| 109 | + String k1 = lineCode + "_" + 0 | |
| 110 | + ,k2 = lineCode + "_" + 1; | |
| 111 | + | |
| 112 | + listMap.putAll(k1, routeListMap.get(k1)); | |
| 113 | + listMap.putAll(k2, routeListMap.get(k2)); | |
| 114 | + return listMap.asMap(); | |
| 115 | + } | |
| 105 | 116 | } | ... | ... |