新增获取完整动态航班信息的接口。
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.gzzn.omms.msgexchangeapi.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.dnld.FLTR;
|
||||
import com.gzzn.omms.msgexchangeapi.service.flightInfo.IFlightInfoService;
|
||||
|
||||
@RestController
|
||||
public class FlightsController {
|
||||
@Autowired
|
||||
private IFlightInfoService flightInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取最新完整的动态航班信息
|
||||
*/
|
||||
@GetMapping("/all/flights")
|
||||
public ResponseDto<List<FLTR>> findAll( ) {
|
||||
return ResponseDto.success(flightInfoService.findAll());
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.gzzn.omms.msgexchangeapi.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class TestController {
|
||||
|
||||
@GetMapping("/test")
|
||||
public void test(HttpServletResponse response) throws IOException {
|
||||
response.getWriter().write("hello");
|
||||
}
|
||||
}
|
||||
+14
@@ -117,4 +117,18 @@ public class FlightInfoServiceImpl implements IFlightInfoService {
|
||||
Set<String> keys = redisService.keys(redisKey + "*");
|
||||
redisService.del(keys);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<FLTR> findAll() {
|
||||
Set<String> keys = redisService.keys(redisKey + "*");
|
||||
|
||||
List<FLTR> lsResult = new ArrayList();
|
||||
keys.forEach(key->{
|
||||
FLTR fltr = (FLTR) redisService.get(key);
|
||||
lsResult.add(fltr);
|
||||
});
|
||||
|
||||
return lsResult;
|
||||
}//end method
|
||||
}
|
||||
|
||||
@@ -6,6 +6,14 @@ import com.gzzn.omms.msgexchangeapi.entity.Cminmsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.schd.dnld.FLTR;
|
||||
|
||||
public interface IFlightInfoService {
|
||||
|
||||
/**
|
||||
* 获取所有动态航班信息
|
||||
* @return 所有最新的动态航班信息
|
||||
*/
|
||||
public List<FLTR> findAll();
|
||||
|
||||
|
||||
/**
|
||||
* 同步日计划更新航班信息
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user