|
|
@ -1,15 +1,15 @@ |
|
|
|
#include <Airmap/services/pilots.h> |
|
|
|
#include <Airmap/services/pilots.h> |
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<airmap::qt::Pilots> airmap::qt::Pilots::create(const std::shared_ptr<Dispatcher>& dispatcher, |
|
|
|
std::shared_ptr<airmap::services::Pilots> airmap::services::Pilots::create(const std::shared_ptr<Dispatcher>& dispatcher, |
|
|
|
const std::shared_ptr<airmap::Client>& client) { |
|
|
|
const std::shared_ptr<airmap::Client>& client) { |
|
|
|
return std::shared_ptr<Pilots>{new Pilots{dispatcher, client}}; |
|
|
|
return std::shared_ptr<Pilots>{new Pilots{dispatcher, client}}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
airmap::qt::Pilots::Pilots(const std::shared_ptr<Dispatcher>& dispatcher, const std::shared_ptr<airmap::Client>& client) |
|
|
|
airmap::services::Pilots::Pilots(const std::shared_ptr<Dispatcher>& dispatcher, const std::shared_ptr<airmap::Client>& client) |
|
|
|
: dispatcher_{dispatcher}, client_{client} { |
|
|
|
: dispatcher_{dispatcher}, client_{client} { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::authenticated(const Authenticated::Parameters& parameters, const Authenticated::Callback& cb) { |
|
|
|
void airmap::services::Pilots::authenticated(const Authenticated::Parameters& parameters, const Authenticated::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().authenticated(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().authenticated(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
@ -17,7 +17,7 @@ void airmap::qt::Pilots::authenticated(const Authenticated::Parameters& paramete |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) { |
|
|
|
void airmap::services::Pilots::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
@ -25,7 +25,7 @@ void airmap::qt::Pilots::for_id(const ForId::Parameters& parameters, const ForId |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::update_for_id(const UpdateForId::Parameters& parameters, const UpdateForId::Callback& cb) { |
|
|
|
void airmap::services::Pilots::update_for_id(const UpdateForId::Parameters& parameters, const UpdateForId::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().update_for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().update_for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
@ -33,7 +33,7 @@ void airmap::qt::Pilots::update_for_id(const UpdateForId::Parameters& parameters |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::start_verify_pilot_phone_for_id(const StartVerifyPilotPhoneForId::Parameters& parameters, |
|
|
|
void airmap::services::Pilots::start_verify_pilot_phone_for_id(const StartVerifyPilotPhoneForId::Parameters& parameters, |
|
|
|
const StartVerifyPilotPhoneForId::Callback& cb) { |
|
|
|
const StartVerifyPilotPhoneForId::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().start_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().start_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
@ -42,7 +42,7 @@ void airmap::qt::Pilots::start_verify_pilot_phone_for_id(const StartVerifyPilotP |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::finish_verify_pilot_phone_for_id(const FinishVerifyPilotPhoneForId::Parameters& parameters, |
|
|
|
void airmap::services::Pilots::finish_verify_pilot_phone_for_id(const FinishVerifyPilotPhoneForId::Parameters& parameters, |
|
|
|
const FinishVerifyPilotPhoneForId::Callback& cb) { |
|
|
|
const FinishVerifyPilotPhoneForId::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().finish_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().finish_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) { |
|
|
@ -51,7 +51,7 @@ void airmap::qt::Pilots::finish_verify_pilot_phone_for_id(const FinishVerifyPilo |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::aircrafts(const Aircrafts::Parameters& parameters, const Aircrafts::Callback& cb) { |
|
|
|
void airmap::services::Pilots::aircrafts(const Aircrafts::Parameters& parameters, const Aircrafts::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().aircrafts(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().aircrafts(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
@ -59,7 +59,7 @@ void airmap::qt::Pilots::aircrafts(const Aircrafts::Parameters& parameters, cons |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::add_aircraft(const AddAircraft::Parameters& parameters, const AddAircraft::Callback& cb) { |
|
|
|
void airmap::services::Pilots::add_aircraft(const AddAircraft::Parameters& parameters, const AddAircraft::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().add_aircraft(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().add_aircraft(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
|
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); |
|
|
@ -67,7 +67,7 @@ void airmap::qt::Pilots::add_aircraft(const AddAircraft::Parameters& parameters, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::delete_aircraft(const DeleteAircraft::Parameters& parameters, |
|
|
|
void airmap::services::Pilots::delete_aircraft(const DeleteAircraft::Parameters& parameters, |
|
|
|
const DeleteAircraft::Callback& cb) { |
|
|
|
const DeleteAircraft::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().delete_aircraft(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().delete_aircraft(parameters, [this, sp, cb](const auto& result) { |
|
|
@ -76,7 +76,7 @@ void airmap::qt::Pilots::delete_aircraft(const DeleteAircraft::Parameters& param |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void airmap::qt::Pilots::update_aircraft(const UpdateAircraft::Parameters& parameters, |
|
|
|
void airmap::services::Pilots::update_aircraft(const UpdateAircraft::Parameters& parameters, |
|
|
|
const UpdateAircraft::Callback& cb) { |
|
|
|
const UpdateAircraft::Callback& cb) { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() { |
|
|
|
sp->client_->pilots().update_aircraft(parameters, [this, sp, cb](const auto& result) { |
|
|
|
sp->client_->pilots().update_aircraft(parameters, [this, sp, cb](const auto& result) { |
|
|
|