Added songcontroller, work on uploading a song

This commit is contained in:
kdeng00
2019-08-18 16:44:59 -04:00
parent e9aa5f799c
commit bbd8186114
3 changed files with 42 additions and 1 deletions
+2 -1
View File
@@ -4,6 +4,7 @@
#include <iostream>
#include <filesystem>
#include <string>
#include <memory>
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/macro/component.hpp"
@@ -18,7 +19,7 @@ class loginController : public oatpp::web::server::api::ApiController
{
public:
loginController(std::string p, OATPP_COMPONENT(std::shared_ptr<ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper), exe_path(std::move(p))
: oatpp::web::server::api::ApiController(objectMapper), exe_path(p)
{ }
+39
View File
@@ -0,0 +1,39 @@
#ifndef SONGCONTROLLER_H_
#define SONGCONTROLLER_H_
#include <iostream>
#include <filesystem>
#include <string>
#include <memory>
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/macro/component.hpp"
#include "oatpp/web/mime/multipart/InMemoryPartReader.hpp"
#include "oatpp/web/mime/multipart/Reader.hpp"
#include "oatpp/web/server/api/ApiController.hpp"
//#include "../dto/DTO.h"
class songController : public oatpp::web::server::api::ApiController
{
public:
songController(std::string p, OATPP_COMPONENT(std::shared_ptr<ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper), exe_path(p)
{ }
#include OATPP_CODEGEN_BEGIN(ApiController)
// TODO: work on uploading a song
ENDPOINT("POST", "/api/v1/song/data", songUpload,
REQUEST(std::shared_ptr<IncomingRequest>, request))
{
return createResonse(Status::CODE_200, "OK");
}
#include OATPP_CODEGEN_END(ApiController)
private:
std::string exe_path;
};
#endif