mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Describe new function in detail in docu/login_server.api.md. Made some changes in existing code to have the option to use a custome email text, not only the pre-formulated texte. Use a new state for returned json, state = warning. If function does what expected but still have a error message. Add the new state in frontend/src/apis/loginAPI.js.
30 lines
1022 B
C++
30 lines
1022 B
C++
#ifndef __JSON_INTERFACE_JSON_REQUEST_HANDLER_
|
|
#define __JSON_INTERFACE_JSON_REQUEST_HANDLER_
|
|
|
|
#include "Poco/Net/HTTPRequestHandler.h"
|
|
#include "Poco/JSON/Object.h"
|
|
|
|
#include "../lib/ErrorList.h"
|
|
|
|
|
|
class JsonRequestHandler : public Poco::Net::HTTPRequestHandler
|
|
{
|
|
public:
|
|
|
|
void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response);
|
|
|
|
virtual Poco::JSON::Object* handle(Poco::Dynamic::Var params) = 0;
|
|
|
|
static Poco::Dynamic::Var parseJsonWithErrorPrintFile(std::istream& request_stream, ErrorList* errorHandler = nullptr, const char* functionName = nullptr);
|
|
|
|
protected:
|
|
Poco::JSON::Object* mResultJson;
|
|
static Poco::JSON::Object* stateError(const char* msg, std::string details = "");
|
|
static Poco::JSON::Object* customStateError(const char* state, const char* msg, std::string details = "");
|
|
static Poco::JSON::Object* stateSuccess();
|
|
static Poco::JSON::Object* stateWarning(const char* msg, std::string details = "");
|
|
|
|
|
|
};
|
|
|
|
#endif // __JSON_INTERFACE_JSON_REQUEST_HANDLER_
|