|
|
@@ -0,0 +1,82 @@
|
|
|
+package com.its.api.op.controller.management;
|
|
|
+
|
|
|
+import com.its.api.op.model.dto.ifsc.TbIfscDto;
|
|
|
+import com.its.api.op.model.dto.link.TbLinkDto;
|
|
|
+import com.its.api.op.model.dto.node.TbNodeDto;
|
|
|
+import com.its.api.op.model.dto.road.TbRoadDto;
|
|
|
+import com.its.api.op.service.ifsc.TbIfscService;
|
|
|
+import com.its.api.op.service.link.TbLinkService;
|
|
|
+import com.its.api.op.service.node.TbNodeService;
|
|
|
+import com.its.api.op.service.road.TbRoadService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Api(tags = "00.교통상황관리-0.메인-9.지도검색")
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RequestMapping("/api/manage/gis/search")
|
|
|
+public class GisSearchController {
|
|
|
+
|
|
|
+ private final TbNodeService nodeService;
|
|
|
+ private final TbLinkService linkService;
|
|
|
+ private final TbIfscService ifscService;
|
|
|
+ private final TbRoadService roadService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "노드검색(TB_NODE)", response = TbNodeDto.class)
|
|
|
+ @GetMapping(value = "/node/{filter}", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbNodeDto> findNodeByFilter(
|
|
|
+ @ApiParam(name = "filter", value = "노드명/아이디", example = "교차로", required = false)
|
|
|
+ @PathVariable final String filter) {
|
|
|
+ return this.nodeService.findByFilter(filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "링크검색(TB_LINK)", response = TbLinkDto.class)
|
|
|
+ @GetMapping(value = "/link/{filter}", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbLinkDto> findLinkByFilter(
|
|
|
+ @ApiParam(name = "filter", value = "도로명/아이디", example = "지방도333호선", required = false)
|
|
|
+ @PathVariable final String filter) {
|
|
|
+ return this.linkService.findByFilter(filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "정보제공구간검색(TB_IFSC)", response = TbLinkDto.class)
|
|
|
+ @GetMapping(value = "/ifsc/{filter}", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbIfscDto> findIfscByFilter(
|
|
|
+ @ApiParam(name = "filter", value = "구간명/아이디", example = "신갈우회도로", required = false)
|
|
|
+ @PathVariable final String filter) {
|
|
|
+ return this.ifscService.findByFilter(filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "도로검색(TB_ROAD)", response = TbLinkDto.class)
|
|
|
+ @GetMapping(value = "/road/{filter}", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbRoadDto> findRoadByFilter(
|
|
|
+ @ApiParam(name = "filter", value = "도로명/아이디", example = "신수로", required = false)
|
|
|
+ @PathVariable final String filter) {
|
|
|
+ return this.roadService.findByFilter(filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 데이터베이스-노드관리의 노드정보개별조회와 동일함
|
|
|
+ * 위의 링크/정보제공구간/도로 조회후 지도 이동시에 이동할 좌표를 구하기 위해 지도검색 컨트롤러에 기능을 추가함.
|
|
|
+ * 시작 또는 종료노드 아이디로 해당 노드의 위치정보를 조회한 후에 지도로 이동한다.
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "노드정보 개별조회-위치이동(TB_NODE)", response = TbNodeDto.class)
|
|
|
+ @GetMapping(value = "/pos/{id}", produces = {"application/json; charset=utf8"})
|
|
|
+ public TbNodeDto findNodeById(
|
|
|
+ @ApiParam(name = "id", value = "노드아이디", example = "2280022000", required = true)
|
|
|
+ @PathVariable final Long id) {
|
|
|
+ return this.nodeService.findById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|