21 lines
494 B
C++
21 lines
494 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <filesystem>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
#include "server.hpp"
|
|
|
|
namespace simple_object_storage {
|
|
|
|
class PutHandler {
|
|
public:
|
|
PutHandler(Server& server);
|
|
void handle_upload_object(const drogon::HttpRequestPtr& req, std::function<void(const drogon::HttpResponsePtr &)>&& callback);
|
|
|
|
private:
|
|
Server& server_;
|
|
void add_file_metadata(const std::string& file_path, nlohmann::json& metadata) const;
|
|
};
|
|
|
|
} // namespace simple_object_storage
|