generated from userver-framework/service_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e458d41
commit 37ec04f
Showing
4 changed files
with
52 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#pragma once | ||
|
||
#include <userver/components/component.hpp> | ||
#include <userver/components/minimal_server_component_list.hpp> | ||
#include <userver/server/handlers/http_handler_base.hpp> | ||
#include <userver/utils/daemon_run.hpp> | ||
|
||
#include <userver/storages/postgres/cluster.hpp> | ||
#include <userver/storages/postgres/component.hpp> | ||
|
||
namespace pastebin { | ||
|
||
using namespace userver; | ||
|
||
class PastesController final : public server::handlers::HttpHandlerBase { | ||
public: | ||
static constexpr std::string_view kName = "handler-pastes"; | ||
|
||
PastesController(const components::ComponentConfig& config, | ||
const components::ComponentContext& context); | ||
|
||
std::string HandleRequestThrow( | ||
const server::http::HttpRequest& request, | ||
server::request::RequestContext&) const override; | ||
|
||
private: | ||
std::string CreatePaste(const server::http::HttpRequest&) const; | ||
std::string GetPaste(std::string_view code, | ||
const server::http::HttpRequest&) const; | ||
std::string UpdatePaste(std::string_view token, | ||
const server::http::HttpRequest&) const; | ||
std::string DeletePaste(std::string_view token, | ||
const server::http::HttpRequest&) const; | ||
|
||
storages::postgres::ClusterPtr pg_cluster_; | ||
}; | ||
|
||
} // namespace pastebin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters