|
|
|
@ -11,6 +11,7 @@ import java.util.HashMap;
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import org.json.simple.JSONObject; |
|
|
|
|
import org.json.simple.parser.JSONParser; |
|
|
|
|
import org.json.simple.parser.ParseException; |
|
|
|
@ -59,7 +60,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
@Slf4j |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping(value = "/api/bas/flight", produces = {MediaType.APPLICATION_JSON_VALUE}) |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@Api(value = "BasFlightController",tags = {"Flight Plan API"}) |
|
|
|
|
public class BasFlightController { |
|
|
|
|
|
|
|
|
|
private final BasFlightService basFlightService; |
|
|
|
@ -76,7 +77,6 @@ public class BasFlightController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/area") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
public ResponseEntity<Object> findAirSpace() throws IOException, ParseException { |
|
|
|
|
// 1. file read
|
|
|
|
|
Resource resource = new ClassPathResource("air/airgeo.json"); |
|
|
|
@ -101,8 +101,7 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
// 비행계획서 조회
|
|
|
|
|
@GetMapping(value = "/plan/list") |
|
|
|
|
@ApiOperation(value = "비행계획서 조회") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Flight Plan List") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> findPlanList(BasFlightPlanListRq rq) { |
|
|
|
|
ComnPagingRs<BasFlightPlanModel> result = null; |
|
|
|
|
// System.out.println(rq);
|
|
|
|
@ -119,9 +118,8 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
// 비행계획서 상세 조회
|
|
|
|
|
@GetMapping(value = "/plan/detail/{planSno}") |
|
|
|
|
@ApiOperation(value = "비행계획서 상세 조회") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiImplicitParam(name = "planSno",value = "비행계획서일련번호", dataTypeClass = Integer.class) |
|
|
|
|
@ApiOperation(value = "Flight Plan Detail") |
|
|
|
|
@ApiImplicitParam(name = "planSno",value = "planSno", dataTypeClass = Integer.class) |
|
|
|
|
public ResponseEntity<? extends BasicResponse> detailPlan(@PathVariable("planSno") Integer planSno) { |
|
|
|
|
BasFlightPlanModel result = null; |
|
|
|
|
try { |
|
|
|
@ -137,8 +135,7 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
// 비행계획서 등록
|
|
|
|
|
@PostMapping(value = "/plan/create") |
|
|
|
|
@ApiOperation(value = "비행계획서 등록") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Create Flight Plan") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> createPlan(@RequestBody BasFlightPlanModel rq) { |
|
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
|
try { |
|
|
|
@ -164,8 +161,7 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
// 비행계획서 수정
|
|
|
|
|
@PutMapping(value = "/plan/update") |
|
|
|
|
@ApiOperation(value = "비행계획서 수정") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Update Flight Plan") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> updatePlan(@RequestBody BasFlightPlanModel rq) { |
|
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
|
try { |
|
|
|
@ -189,9 +185,8 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
// 비행계획서 삭제
|
|
|
|
|
@DeleteMapping(value = "/plan/delete/{planSno}") |
|
|
|
|
@ApiOperation(value = "비행계획서 삭제") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiImplicitParam(name = "planSno",value = "비행계획서일련번호", dataTypeClass = Integer.class) |
|
|
|
|
@ApiOperation(value = "Delete Flight Plan") |
|
|
|
|
@ApiImplicitParam(name = "planSno",value = "planSno", dataTypeClass = Integer.class) |
|
|
|
|
public ResponseEntity<? extends BasicResponse> deletePlan(@PathVariable("planSno") Integer planSno) { |
|
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
|
try { |
|
|
|
@ -214,9 +209,8 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
// 그룹 조종사 조회
|
|
|
|
|
@GetMapping(value = "/plan/pilot/{groupId}") |
|
|
|
|
@ApiOperation(value = "그룹의 조종사 조회") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiImplicitParam(name = "groupId",value = "그룹ID", dataTypeClass = String.class) |
|
|
|
|
@ApiOperation(value = "Group Pilot List") |
|
|
|
|
@ApiImplicitParam(name = "groupId",value = "groupId", dataTypeClass = String.class) |
|
|
|
|
public ResponseEntity<? extends BasicResponse> findPilot(@PathVariable("groupId") String groupId) { |
|
|
|
|
List<BasFlightPlanPilotModel> result = null; |
|
|
|
|
try { |
|
|
|
@ -233,9 +227,8 @@ public class BasFlightController {
|
|
|
|
|
} |
|
|
|
|
// 그룹 기체 조회
|
|
|
|
|
@GetMapping(value = "/plan/arcrft/{groupId}") |
|
|
|
|
@ApiOperation(value = "그룹의 기체 조회") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiImplicitParam(name = "groupId",value = "그룹ID", dataTypeClass = String.class) |
|
|
|
|
@ApiOperation(value = "Group Arcrft") |
|
|
|
|
@ApiImplicitParam(name = "groupId",value = "groupId", dataTypeClass = String.class) |
|
|
|
|
public ResponseEntity<? extends BasicResponse> findArcrft(@PathVariable("groupId") String groupId) { |
|
|
|
|
List<BasFlightPlanArcrftModel> result = null; |
|
|
|
|
try { |
|
|
|
@ -252,8 +245,7 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
// 비행 구역 버퍼 존 생성
|
|
|
|
|
@PostMapping("/plan/area/buffer") |
|
|
|
|
@ApiOperation(value = "비행 구역 버퍼 존 생성") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Flight area buffer Create") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> findBuffer(@RequestBody List<BasFlightPlanAreaModel> rq) { |
|
|
|
|
List<BasFlightPlanAreaModel> rs = null; |
|
|
|
|
try { |
|
|
|
@ -268,8 +260,7 @@ public class BasFlightController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/plan/api/weather") |
|
|
|
|
@ApiOperation(value = "비행계획서 날씨") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Flight Plan Weather") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> restApiGetWeather(BasFlightWeatherModel rq){ |
|
|
|
|
JSONObject jsonObject = null; |
|
|
|
|
|
|
|
|
@ -286,8 +277,7 @@ public class BasFlightController {
|
|
|
|
|
} |
|
|
|
|
// 비행계획서 리스트(승인)
|
|
|
|
|
@GetMapping(value = "/aprv/list") |
|
|
|
|
@ApiOperation(value = "비행계획서 리스트(승인)") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Flight Plan Aprv List") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> findAprvList(BasFlightPlanListRq rq) { |
|
|
|
|
ComnPagingRs<BasFlightPlanModel> result = null; |
|
|
|
|
try { |
|
|
|
@ -302,8 +292,7 @@ public class BasFlightController {
|
|
|
|
|
} |
|
|
|
|
// 비행계획서 승인/미승인
|
|
|
|
|
@PutMapping(value = "/aprv/proc") |
|
|
|
|
@ApiOperation(value = "비행 계획서 승인/미승인") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Flight Plan aprv/proc") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> updateAprvProc(@RequestBody BasFlightAprovRq rq) { |
|
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
|
try { |
|
|
|
@ -326,7 +315,6 @@ public class BasFlightController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/airspace/contains") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> checkAirspaceContains(@RequestBody List<BasFlightPlanAreaModel> rq) { |
|
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
|
try { |
|
|
|
@ -345,14 +333,13 @@ public class BasFlightController {
|
|
|
|
|
|
|
|
|
|
//지역 검색
|
|
|
|
|
@GetMapping("/plan/area/search") |
|
|
|
|
@ApiOperation(value = "지역 검색") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
@ApiOperation(value = "Search area") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> searchArea(String query) throws ParseException { |
|
|
|
|
String text = null; |
|
|
|
|
try { |
|
|
|
|
text = URLEncoder.encode(query, "UTF-8"); |
|
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
|
throw new RuntimeException("검색어 인코딩 실패", e); |
|
|
|
|
throw new RuntimeException("Search Encoding Fail", e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String apiURL = env.getProperty("api.naver.search-url") + "?query=" + text + "&display=5"; |
|
|
|
@ -368,7 +355,6 @@ public class BasFlightController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/schedule") |
|
|
|
|
@Tag(name = "비행계획서", description = "비행계획서 관련 API") |
|
|
|
|
public ResponseEntity<? extends BasicResponse> findSchedule(@RequestParam("searchDate") String searchDate) { |
|
|
|
|
List<BasFlightScheduleRs> response; |
|
|
|
|
|
|
|
|
|