generated from Sithas/conan_template
Доработка интерфейса ДАО
This commit is contained in:
@@ -26,18 +26,27 @@ public:
|
||||
boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req
|
||||
) override
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::json;
|
||||
using namespace boost::beast;
|
||||
|
||||
auto body = req.body();
|
||||
boost::json::object json_as_object = boost::json::parse(body).as_object();
|
||||
object json_as_object = json::parse(body).as_object();
|
||||
|
||||
std::string login = boost::json::serialize(json_as_object.at("login").as_string());
|
||||
std::string password = boost::json::serialize(json_as_object.at("password").as_string());
|
||||
std::string login = serialize(json_as_object.at("login").as_string());
|
||||
std::string password = serialize(json_as_object.at("password").as_string());
|
||||
|
||||
boost::beast::http::response<ResponseType> res{
|
||||
boost::beast::http::status::ok, req.version()
|
||||
User user;
|
||||
|
||||
user.SetLogin(login);
|
||||
user.SetPassword(password);
|
||||
|
||||
http::response<ResponseType> res{
|
||||
http::status::ok, req.version()
|
||||
};
|
||||
|
||||
res.body() = "{ \"detail\": \"ok\"}";
|
||||
res.set(boost::beast::http::field::content_type, "application/json");
|
||||
res.set(http::field::content_type, "application/json");
|
||||
res.content_length(res.body().size());
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user