配置文件部分
配置文件 config/订阅节点
-
基本配置
- IP地址
IPAddress::from('192.168.1.1'); - 服务提供商 (SSP)
ServiceProvider::from('OpenStack'); - 路由规则
Route::from([ '/bookFlight': [ 'function' => 'bookFlight', 'parameters' => [ 'Flight' => 'Flight', ' aircraft' => 'airplane', ' origin' => 'origin', ' destination' => 'destination', ' isFareValid' => true, ' is delay' => false, ' is refund' => false, ' error' => false, ' error reason' => 'invalid flight', ' error message' => 'invalid flight', ], ] ]); - 访问权限
Access::from([ 'read' => true, 'write' => true, 'executeCommand' => true, 'delete' => true, 'search' => true, 'update' => true, ]);
- IP地址
-
日志配置
Log::from([ 'output' => 'logs', 'outputPath' => '/var/log/flight_logs', 'format' => '%(message)s', 'level' => 'DEBUG', 'handler' => 'tailwind', ]);
-
内部路由
Route::from([ '/bookFlight' => [ 'function' => 'bookFlight', 'parameters' => [ 'Flight' => 'Flight', ' aircraft' => 'airplane', ' origin' => 'origin', ' destination' => 'destination', ' isFareValid' => true, ' is delay' => false, ' is refund' => false, ' error' => false, ' error reason' => 'invalid flight', ' error message' => 'invalid flight', ], ] ]); -
节点配置
#[Node::class] #[Name::class 'FlightNode' @Name::class 'flight_node')] #[IP::class '192.168.1.1' @IP::class 'localhost'] #[ServiceProvider::class 'OpenStack' @SSP::class 'OpenStack'] #[Route::class 'flight_nodeRoute' @Route::class 'route_node_route'] #[Access::class 'AccessNodeAccess' @Access::class 'AccessNodeAccess'] #[Log::class 'flight_logs' @Log::class 'flight_logs']
-
运行配置
#[Run::class] #[DefaultValues] #[Log::class 'logs']
运行配置部分
日志配置
- 输出路径
Logs::from([ 'output' => 'logs', 'outputPath' => '/var/log/flight_logs', ]);
- 日志等级
Level::from([ 'DEBUG' => Logger::DEBUG, ]);
- 日志格式
Format::from([ '%(message)s', ]);
- 自动重置日志文件
AutoResetLogFiles::from([ 'name' => 'flight_logs', 'on' => 'true', 'how' => 'auto', ]);
验证和测试
- 使用
tailwind或其他日志工具查看日志输出。 - 检查节点是否正常运行,确认日志文件是否正确生成。
通过以上步骤,确保机场订阅节点的配置正确,能够有效管理航班订阅、退票和取消等操作。




