Доработка интерфейса ДАО

This commit is contained in:
Антон
2025-08-29 18:33:53 +03:00
parent 60339d9195
commit 1a1fd07d55
7 changed files with 46 additions and 12 deletions
@@ -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;