59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "lib/api/services/OrderService.pb.h"
|
|
#include "lib/orderman/orderman_utils/orderman_common.h"
|
|
#include <memory>
|
|
|
|
namespace bts {
|
|
namespace api {
|
|
namespace admin {
|
|
class AdminData;
|
|
}
|
|
} // namespace api
|
|
} // namespace bts
|
|
|
|
namespace bts {
|
|
namespace orderman {
|
|
|
|
class OrderRouter {
|
|
public:
|
|
OrderRouter();
|
|
~OrderRouter();
|
|
|
|
void update(api::admin::AdminData const &);
|
|
|
|
struct RouteQueryResult {
|
|
bool has_route;
|
|
std::string error_msg;
|
|
api::orderman::RoutingRecord routing_record;
|
|
};
|
|
RouteQueryResult get_routing_record(
|
|
std::string const &user,
|
|
std::string const &account,
|
|
api::Security const &sec) const;
|
|
|
|
RouteQueryResult
|
|
get_routing_record(UserID, AccountID, api::Security const &) const;
|
|
bool is_valid_session(std::string const &session) const;
|
|
|
|
struct ReverseRoutingQueryResult {
|
|
bool ok;
|
|
std::string error_msg;
|
|
std::string user;
|
|
UserID user_id;
|
|
std::string account;
|
|
AccountID account_id;
|
|
};
|
|
ReverseRoutingQueryResult get_reverse_routing_record(
|
|
std::string const &session,
|
|
std::string const &operator_id,
|
|
std::string const &account,
|
|
api::Security const *sec /* can be null */) const;
|
|
|
|
private:
|
|
struct PImpl;
|
|
std::unique_ptr<PImpl> me;
|
|
};
|
|
} // namespace orderman
|
|
} // namespace bts
|