Commit bec3ed603770164470229e9ee95a948451759997
1 parent
96920fe4
update...
Showing
3 changed files
with
37 additions
and
9 deletions
src/main/java/com/bsth/CXFConfig.java
| ... | ... | @@ -4,6 +4,7 @@ import com.bsth.server_rs.AuthorizeInterceptor_IN; |
| 4 | 4 | import com.bsth.server_rs.base_info.car.CarRestService; |
| 5 | 5 | import com.bsth.server_rs.base_info.line.LineRestService; |
| 6 | 6 | import com.bsth.server_rs.base_info.person.PersonRestService; |
| 7 | +import com.bsth.server_rs.base_info.section.LD_RoadSpeedRestService; | |
| 7 | 8 | import com.bsth.server_rs.base_info.section.LD_SectionRestService; |
| 8 | 9 | import com.bsth.server_rs.base_info.station.StationRestService; |
| 9 | 10 | import com.bsth.server_rs.directive.DirectiveRestService; |
| ... | ... | @@ -98,6 +99,8 @@ public class CXFConfig { |
| 98 | 99 | GpsRestService gpsRestService; |
| 99 | 100 | @Autowired |
| 100 | 101 | DirectiveRestService directiveRestService; |
| 102 | + @Autowired | |
| 103 | + LD_RoadSpeedRestService ld_roadSpeedRestService; | |
| 101 | 104 | |
| 102 | 105 | @Bean |
| 103 | 106 | public Server rsServer() { |
| ... | ... | @@ -114,7 +117,8 @@ public class CXFConfig { |
| 114 | 117 | ldSectionRestService, |
| 115 | 118 | schedulePlanService, |
| 116 | 119 | realLogRestService, |
| 117 | - directiveRestService)); | |
| 120 | + directiveRestService, | |
| 121 | + ld_roadSpeedRestService)); | |
| 118 | 122 | endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(), new AesExceptionMapper())); |
| 119 | 123 | //endpoint.setFeatures(Arrays.asList(new Swagger2Feature())); |
| 120 | 124 | endpoint.getInInterceptors().add(new AuthorizeInterceptor_IN()); | ... | ... |
src/main/java/com/bsth/server_rs/base_info/section/LD_RoadSpeedRestService.java
0 → 100644
| 1 | +package com.bsth.server_rs.base_info.section; | |
| 2 | + | |
| 3 | +import com.bsth.server_rs.base_info.section.buffer.LD_SectionBufferData; | |
| 4 | +import com.bsth.server_rs.base_info.section.entity.RoadSpeed; | |
| 5 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | +import org.springframework.stereotype.Component; | |
| 7 | + | |
| 8 | +import javax.ws.rs.GET; | |
| 9 | +import javax.ws.rs.Path; | |
| 10 | +import javax.ws.rs.PathParam; | |
| 11 | +import javax.ws.rs.Produces; | |
| 12 | +import javax.ws.rs.core.MediaType; | |
| 13 | +import java.util.List; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * 路段限速信息 | |
| 17 | + * Created by panzhao on 2017/11/12. | |
| 18 | + */ | |
| 19 | +@Component | |
| 20 | +@Path("/road_speed_config") | |
| 21 | +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 22 | +public class LD_RoadSpeedRestService { | |
| 23 | + | |
| 24 | + @Autowired | |
| 25 | + LD_SectionBufferData sectionBufferData; | |
| 26 | + | |
| 27 | + @GET | |
| 28 | + @Path("{company}") | |
| 29 | + public List<RoadSpeed> roadSpeedList(@PathParam("company") String company){ | |
| 30 | + return sectionBufferData.roadSpeedList(company); | |
| 31 | + } | |
| 32 | +} | ... | ... |
src/main/java/com/bsth/server_rs/base_info/section/LD_SectionRestService.java
| ... | ... | @@ -2,7 +2,6 @@ package com.bsth.server_rs.base_info.section; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.server_rs.base_info.section.buffer.LD_SectionBufferData; |
| 4 | 4 | import com.bsth.server_rs.base_info.section.entity.LD_SectionRoute; |
| 5 | -import com.bsth.server_rs.base_info.section.entity.RoadSpeed; | |
| 6 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 6 | import org.springframework.stereotype.Component; |
| 8 | 7 | |
| ... | ... | @@ -12,7 +11,6 @@ import javax.ws.rs.PathParam; |
| 12 | 11 | import javax.ws.rs.Produces; |
| 13 | 12 | import javax.ws.rs.core.MediaType; |
| 14 | 13 | import java.util.Collection; |
| 15 | -import java.util.List; | |
| 16 | 14 | import java.util.Map; |
| 17 | 15 | |
| 18 | 16 | /** |
| ... | ... | @@ -32,10 +30,4 @@ public class LD_SectionRestService { |
| 32 | 30 | public Map<String, Collection<LD_SectionRoute>> findByCompany(@PathParam("company") String company){ |
| 33 | 31 | return sectionBufferData.findRouteByCompany(company); |
| 34 | 32 | } |
| 35 | - | |
| 36 | - @GET | |
| 37 | - @Path("/road_speed_config/{company}") | |
| 38 | - public List<RoadSpeed> roadSpeedList(@PathParam("company") String company){ | |
| 39 | - return sectionBufferData.roadSpeedList(company); | |
| 40 | - } | |
| 41 | 33 | } | ... | ... |