36 lines
1.0 KiB
Java
36 lines
1.0 KiB
Java
package com.gzzn.omms.msgexchangeapi.controller;
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import com.gzzn.omms.msgexchangeapi.dto.ResponseDto;
|
|
import com.gzzn.omms.msgexchangeapi.entity.msg.SCHD;
|
|
import com.gzzn.omms.msgexchangeapi.service.flightInfo.IFlightInfoService;
|
|
|
|
@RestController
|
|
public class FlightsController {
|
|
@Autowired
|
|
private IFlightInfoService flightInfoService;
|
|
|
|
|
|
/**
|
|
* 获取最新完整的动态航班信息
|
|
*/
|
|
@GetMapping("/all/flights")
|
|
public ResponseDto<List<SCHD.FLTR>> findAll( ) {
|
|
List<SCHD.FLTR> fltrs = flightInfoService.findAll();
|
|
|
|
//过滤只返回非共享航班的信息
|
|
List<SCHD.FLTR> fltrsRt = fltrs.stream().filter(node-> {
|
|
return (node.getMAID() == null);
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
return ResponseDto.success(fltrsRt);
|
|
}
|
|
}
|