加入返回时不返回共享航班动态的功能

This commit is contained in:
zhouxiunai
2019-01-25 09:33:22 +08:00
parent 6444147bcd
commit 873f940170
@@ -1,6 +1,7 @@
package com.gzzn.omms.msgexchangeapi.controller; package com.gzzn.omms.msgexchangeapi.controller;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -21,6 +22,14 @@ public class FlightsController {
*/ */
@GetMapping("/all/flights") @GetMapping("/all/flights")
public ResponseDto<List<SCHD.FLTR>> findAll( ) { public ResponseDto<List<SCHD.FLTR>> findAll( ) {
return ResponseDto.success(flightInfoService.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);
} }
} }