generated from Sithas/conan_template
База для ручки PostUserMedicationsExecutor.h
This commit is contained in:
@@ -13,4 +13,25 @@ public:
|
|||||||
) = 0;
|
) = 0;
|
||||||
virtual ~IExecutor() = default;
|
virtual ~IExecutor() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class IAuthorizable : public IExecutor
|
||||||
|
{
|
||||||
|
IExecutor& next_executor_;
|
||||||
|
public:
|
||||||
|
IAuthorizable(IExecutor& next_executor): next_executor_(next_executor)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::beast::http::response<ResponseType> operator ()(
|
||||||
|
boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req
|
||||||
|
) override
|
||||||
|
{
|
||||||
|
// Логика проверки авторизации
|
||||||
|
// передать управление следующему executorу - возврат req
|
||||||
|
// посмотреть chain of responsibility, composite
|
||||||
|
// выбрасывать исключение здесь
|
||||||
|
return next_executor_(req);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user