diff --git a/internal/domain/fpl.go b/internal/domain/fpl.go index 60e41b0..b150b1b 100644 --- a/internal/domain/fpl.go +++ b/internal/domain/fpl.go @@ -31,37 +31,48 @@ Group 19: Supplementary information (if needed) */ /* -(FPL-CCA1532-IS --A332/H --SDE3FGHIJ4J5M1RWY/LB101 --ZSSS2035 --K0859S1040 PIAKS G330 PIMOL A539 BTO W82 DOGAR --ZBAA0153 ZBYN --PBN/A1B2B3B4B5D1L1 NAV/ABAS REG/B6513 EET/ZBPE0112 SEL/KMAL PER/C RIF/FRT N640 ZBYN RMK/TCAS EQUIPPED) - +Example message: +(FPL-JAE7433-IS +-B744/H-SXIRPZJWY/S +-ZBTJ1755 +-K0926S0920 CG A326 VYK W80 HUR B339 GM A575 MANSA/K0919S0980 A575 + INTIK/K0917S0960 A575 UDA DCT BULAG A200 HATGA/K0900S1060 A308 + LARNA DCT RATKO A307 KUMOD R497 TODES B228 ZJ R22 KTL R30 SPB + B141 RANVA/N0485F360 UP863 DEREX UP739 KOLJA UN746 GORPI UZ80 + TILAV UL87 TADUV T173 GED GED2W +-EDDF0948 EDDK +-EET/ZMUB0100 UNKL0236 UNWW0332 UNNT0332 USRR0447 USHH0507 + USSS0535 UUYY0602 ULKK0634 ULWW0653 ULLL0720 EETT0748 EVRR0815 + ESAA0821 EPWW0848 EDUU0900 + REG/B2422 SEL/JLAD OPR/JADE CARGO DAT/S RVR/200 + NAV/RNAV1 RNAV5 RNP4 + RMK/AGCS EQUIPPED + ACARS EQUIPPED/TCAS EQUIPPED/FOREIGN PILOT + E/1148 P/TBN R/UV S/M J/LF D/1 15 C YELLOW + A/WHITE GREEN) */ -// FPL 电报体中的飞行计划报文结构 +// FPL represents the structure of a Flight Plan message in the FPL telegram body type FPL struct { Category string `json:"category"` // 电报类别: The category of the telegram (e.g., 'FPL' for Flight Plan). - FlightNumber string `json:"flight_number"` // 航班号: The flight number (e.g., 'CCA1532'). + FlightNumber string `json:"flight_number"` // 航班号: The flight number (e.g., 'JAE7433'). ReferenceData string `json:"reference_data,omitempty"` // 参考数据(可选): Reference data, if applicable. - AircraftID string `json:"aircraft_id"` // 航空器识别标志: The aircraft identification (e.g., 'A332/H'). - SSRModeAndCode string `json:"ssr_mode_and_code"` // SSR 模式及编码: The SSR mode and code (e.g., 'SDE3FGHIJ4J5M1RWY/LB101'). + AircraftID string `json:"aircraft_id"` // 航空器识别标志: The aircraft identification (e.g., 'B744/H'). + SSRModeAndCode string `json:"ssr_mode_and_code"` // SSR 模式及编码: The SSR mode and code (e.g., 'SXIRPZJWY/S'). FlightRulesAndType string `json:"flight_rules_and_type"` // 飞行规则和类型: Flight rules and type (e.g., 'IS'). - CruisingSpeedAndLevel string `json:"cruising_speed_and_level"` // 巡航速度和飞行高度: Cruising speed and flight level (e.g., 'K0859S1040'). - DepartureAirport string `json:"departure_airport"` // 起飞机场: Departure airport code (e.g., 'ZSSS'). - DepartureTime string `json:"departure_time"` // 起飞时间: Departure time (e.g., '2035'). - Route string `json:"route"` // 航路: The flight route (e.g., 'PIAKS G330 PIMOL A539 BTO W82 DOGAR'). - DestinationAndTotalTime string `json:"destination_and_total_time"` // 目的地机场和估计总耗时: Destination airport and estimated total time (e.g., 'ZBAA0153'). - AlternateAirport string `json:"alternate_airport,omitempty"` // 目的地备降机场(可选): Alternate airport (e.g., 'ZBYN'). + CruisingSpeedAndLevel string `json:"cruising_speed_and_level"` // 巡航速度和飞行高度: Cruising speed and flight level (e.g., 'K0926S0920'). + DepartureAirport string `json:"departure_airport"` // 起飞机场: Departure airport code (e.g., 'ZBTJ'). + DepartureTime string `json:"departure_time"` // 起飞时间: Departure time (e.g., '1755'). + Route string `json:"route"` // 航路: The flight route (e.g., 'CG A326 VYK W80 HUR ... GED2W'). + DestinationAndTotalTime string `json:"destination_and_total_time"` // 目的地机场和估计总耗时: Destination airport and estimated total time (e.g., 'EDDF0948'). + AlternateAirport string `json:"alternate_airport,omitempty"` // 目的地备降机场(可选): Alternate airport (e.g., 'EDDK'). OtherInfo string `json:"other_info,omitempty"` // 其他信息(可选): Other information. SupplementaryInfo string `json:"supplementary_info,omitempty"` // 补充信息(可选): Supplementary information. - EstimatedArrivalTime string `json:"estimated_arrival_time"` // 预计到达时间: Estimated time of arrival (e.g., '0153'). + EstimatedArrivalTime string `json:"estimated_arrival_time"` // 预计到达时间: Estimated time of arrival (e.g., '0948'). PBN string `json:"pbn"` // 性能导航: Performance-based navigation equipment (e.g., 'A1B2B3B4B5D1L1'). NavigationEquipment string `json:"navigation_equipment"` // 导航设备: Navigation equipment (e.g., 'NAV/ABAS'). - EstimatedElapsedTime string `json:"estimated_elapsed_time"` // 估计飞行时间: Estimated elapsed time (e.g., 'EET/ZBPE0112'). - SELCALCode string `json:"selcal_code"` // SELCAL代码: SELCAL code (e.g., 'KMAL'). + EstimatedElapsedTime string `json:"estimated_elapsed_time"` // 估计飞行时间: Estimated elapsed time (e.g., 'EET/ZMUB0100'). + SELCALCode string `json:"selcal_code"` // SELCAL代码: SELCAL code (e.g., 'JLAD'). PerformanceCategory string `json:"performance_category"` // 性能类别: Aircraft performance category (e.g., 'C'). RerouteInformation string `json:"reroute_information,omitempty"` // 重航信息(可选): Reroute information (e.g., 'RIF/FRT N640 ZBYN'). Remarks string `json:"remarks,omitempty"` // 备注(可选): Remarks (e.g., 'RMK/TCAS EQUIPPED'). @@ -69,7 +80,6 @@ type FPL struct { // Validate validates the FPL struct fields func (f *FPL) Validate() error { - //add validation logic here if f.FlightNumber == "" { return fmt.Errorf("flight number is required") }