refactor: Add support for parsing JD Airlines flight schedule data
This commit is contained in:
@@ -15,6 +15,7 @@ type LineParser struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CANCELLED = "CNL"
|
||||
AirportCode = "airport"
|
||||
Date = "date"
|
||||
Task = "task"
|
||||
@@ -173,6 +174,10 @@ func ParseWithDef(line string, parserDef *LineParser) *domain.ScheduleLine {
|
||||
var flightSchedule = &domain.ScheduleLine{
|
||||
Reference: line,
|
||||
}
|
||||
if strings.Contains(line, CANCELLED) {
|
||||
flightSchedule.Comments = "Cancelled"
|
||||
return flightSchedule
|
||||
}
|
||||
// var result map[string]string
|
||||
if parserDef == nil {
|
||||
log.Warnf("No definition found: %s", line)
|
||||
|
||||
Reference in New Issue
Block a user