2025-11-14 08:42:26 +08:00
|
|
|
package parser
|
|
|
|
|
|
2025-12-24 16:38:03 +08:00
|
|
|
import (
|
|
|
|
|
"caatsm/internal/adapter/dto"
|
|
|
|
|
"caatsm/internal/port"
|
|
|
|
|
)
|
2025-11-17 11:47:23 +08:00
|
|
|
|
|
|
|
|
// AviationParser implements the Parser interface
|
|
|
|
|
type AviationParser struct{}
|
|
|
|
|
|
|
|
|
|
// Parse parses a raw message string and returns a ParsedTelegram
|
|
|
|
|
func (p *AviationParser) Parse(rawText string) (*dto.ParsedTelegram, error) {
|
|
|
|
|
return Parse(rawText)
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-24 16:38:03 +08:00
|
|
|
// ProvideParser creates a composite parser instance that combines weather and aviation parsers
|
|
|
|
|
func ProvideParser(weatherParser port.WeatherParser) Parser {
|
|
|
|
|
aviation := &AviationParser{}
|
|
|
|
|
return NewCompositeParser(aviation, weatherParser)
|
2025-11-14 08:42:26 +08:00
|
|
|
}
|
|
|
|
|
|