@startuml inline_umlgraph_1.png
user -> api: x1::XLTApi::insert_order()
api --> xlight: 委托请求
xlight --> "t(d)gw": 委托请求
"t(d)gw" --> xlight: 申报成功响应
xlight --> api: 申报成功响应
api --> user: x1::XLTTradeSpi::on_order_response()

loop 每笔成交
    "t(d)gw" --> xlight: 成交回报
    xlight --> api: 成交回报
    api --> user: x1::XLTTradeSpi::on_trade_report()
end

xlight --> api: 订单结束通知
api --> user: x1::XLTTradeSpi::on_order_end()
@enduml
@startuml inline_umlgraph_2.png
user -> api: x1::XLTApi::insert_order()
api -> xlight: 委托请求
xlight -> "t(d)gw": 委托请求
"t(d)gw" -> xlight: 拒单/废单
xlight -> api: 委托失败
api -> user: x1::XLTTradeSpi::on_order_error_response()
@enduml
@startuml inline_umlgraph_3.png
user -> api: x1::XLTApi::cancel_order()
api -> xlight: 撤单请求
xlight -> "t(d)gw": 撤单请求
"t(d)gw" -> xlight: 撤单成功响应
xlight -> api: 撤单成功
api -> user: x1::XLTTradeSpi::on_cancel_response()
xlight -> api: 原订单结束通知
api -> user: x1::XLTTradeSpi::on_order_end()
@enduml
@startuml inline_umlgraph_4.png
user -> api: x1::XLTApi::cancel_order()
api -> xlight: 撤单请求
xlight -> "t(d)gw": 撤单请求
"t(d)gw" -> xlight: 撤单成功响应
xlight -> api: 撤单成功
api -> user: x1::XLTTradeSpi::on_cancel_response()

loop 每笔成交
    "t(d)gw" -> xlight: 原订单成交回报
    xlight -> api: 原订单成交回报
    api -> user: x1::XLTTradeSpi::on_trade_report()
end

xlight -> api: 原订单结束通知
api -> user: x1::XLTTradeSpi::on_order_end()
@enduml
@startuml inline_umlgraph_5.png
user -> api: x1::XLTApi::cancel_order()
api -> xlight: 撤单请求
xlight -> "t(d)gw": 撤单请求
"t(d)gw" -> xlight: 撤单失败
xlight -> api: 撤单失败
api -> user: x1::XLTTradeSpi::on_order_error_response()
@enduml
