Scorum
advertising_api.cpp
Go to the documentation of this file.
3 
4 namespace scorum {
5 namespace app {
6 
8  : _impl(std::make_unique<impl>(*ctx.app.chain_database(),
9  static_cast<chain::data_service_factory_i&>(*ctx.app.chain_database())))
10 {
11 }
12 
14 
15 fc::optional<account_api_obj> advertising_api::get_moderator() const
16 {
17  return _impl->_db.with_read_lock([&] { return _impl->get_moderator(); });
18 }
19 
20 std::vector<budget_api_obj> advertising_api::get_user_budgets(const std::string& user) const
21 {
22  return _impl->_db.with_read_lock([&] { return _impl->get_user_budgets(user); });
23 }
24 
25 fc::optional<budget_api_obj> advertising_api::get_budget(uuid_type uuid, budget_type type) const
26 {
27  return _impl->_db.with_read_lock([&] { return _impl->get_budget(uuid, type); });
28 }
29 
30 std::vector<budget_api_obj> advertising_api::get_current_winners(budget_type type) const
31 {
32  return _impl->_db.with_read_lock([&] { return _impl->get_current_winners(type); });
33 }
34 
35 std::vector<percent_type> advertising_api::get_auction_coefficients(budget_type type) const
36 {
37  return _impl->_db.with_read_lock([&] { return _impl->get_auction_coefficients(type); });
38 }
39 
41 {
42  // do nothing
43 }
44 }
45 }
advertising_api(const api_context &ctx)
std::vector< budget_api_obj > get_current_winners(budget_type type) const
Get winners for particular budget type.
std::vector< budget_api_obj > get_user_budgets(const std::string &user) const
Get all advertising budgets which belong to provided user. Newer first.
fc::optional< budget_api_obj > get_budget(uuid_type uuid, budget_type type) const
Get advertising budget.
fc::optional< account_api_obj > get_moderator() const
Get Advertising budgets moderator if exists.
std::vector< percent_type > get_auction_coefficients(budget_type type) const
Get winners for particular budget type.
Definition: asset.cpp:15
boost::uuids::uuid uuid_type
Definition: types.hpp:53