generated from Sithas/conan_template
Delete Diary
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "GetDiariesExecutor.h"
|
||||
#include "PostDiaryExecutor.h"
|
||||
#include "PutDiaryExecutor.h"
|
||||
#include "DeleteDiaryExecutor.h"
|
||||
#include "../DAO/IUserDAO.h"
|
||||
#include "../DAO/IAuthDAO.h"
|
||||
#include "../DAO/IDiariesDAO.h"
|
||||
@@ -202,15 +203,31 @@ public:
|
||||
parts[0] == "api" &&
|
||||
parts[2] == "Diaries")
|
||||
{
|
||||
std::string uuid = std::string(parts[3]);
|
||||
|
||||
if (req.method() == boost::beast::http::verb::put)
|
||||
try
|
||||
{
|
||||
return send(PutDiaryExecutor<Body, Allocator, ResponseType>(
|
||||
session_,
|
||||
auth_dao_,
|
||||
diaries_dao_
|
||||
)(std::move(req), uuid));
|
||||
std::string uuid = std::string(parts[3]);
|
||||
|
||||
if (req.method() == boost::beast::http::verb::put)
|
||||
{
|
||||
return send(PutDiaryExecutor<Body, Allocator, ResponseType>(
|
||||
session_,
|
||||
auth_dao_,
|
||||
diaries_dao_
|
||||
)(std::move(req), uuid));
|
||||
}
|
||||
|
||||
if (req.method() == boost::beast::http::verb::delete_)
|
||||
{
|
||||
return send(DeleteDiaryExecutor<Body, Allocator, ResponseType>(
|
||||
session_,
|
||||
auth_dao_,
|
||||
diaries_dao_
|
||||
)(std::move(req), uuid));
|
||||
}
|
||||
}
|
||||
catch (const session_exception& e)
|
||||
{
|
||||
return send(SendSessionExceptionError(std::move(req), e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user