fix(acm2-107): finalize /all/flights contract and FLTR JSON payload

Close Q21 into C-11 and emit day-schedule FLTR-shaped JSON for Redis, schd, and query responses.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
windyboy
2026-09-23 11:23:37 +08:00
co-authored by Cursor
parent 43bb561f47
commit f45a0ac898
10 changed files with 103 additions and 50 deletions
@@ -15,8 +15,8 @@ import io.micronaut.http.annotation.Produces
* 数据只从投影来,不回落 PG:查询与网页客户端必须读同一份,不然两边会看到不同的航班
* (`INV-11`)。投影读不出来就返回错误——空列表会被前端当成"现在没有航班"`US-12` AC2)。
*
* 响应口径暂定(`Q21`):成功裸 JSON 数组、不套旧系统的 `ResponseDto`;失败503 加一个
* 错误对象。投影载荷的形状与 `KAFKA:schd` 同一份,尚未按旧系统 `SCHD.FLTR` 逐字对拍
* 成功裸 JSON 数组、不套旧系统的 `ResponseDto`;失败503 加错误对象(`C-11`)。
* 数组元素与 `KAFKA:schd` 同形,都是日计划 `FLTR` 转成的 JSON`C-9`、`C-11`
*/
@Controller("/all/flights")
class FlightQueryController(
@@ -45,7 +45,7 @@ class FlightQueryController(
private fun nonSharedFlights(): List<com.fasterxml.jackson.databind.JsonNode> =
projection.readAll()
.map { mapper.readTree(it) }
.filter { it.path("scalars").path("MAID").asText("").isBlank() }
.filter { it.path("MAID").asText("").isBlank() }
private companion object {
private const val PROJECTION_UNAVAILABLE = "FLIGHT_PROJECTION_UNAVAILABLE"