mirror of
https://github.com/johndoe6345789/WizardMerge.git
synced 2026-04-24 13:44:55 +00:00
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
/**
|
|
* @file MergeController.h
|
|
* @brief HTTP controller for merge operations
|
|
*/
|
|
|
|
#ifndef WIZARDMERGE_CONTROLLERS_MERGE_CONTROLLER_H
|
|
#define WIZARDMERGE_CONTROLLERS_MERGE_CONTROLLER_H
|
|
|
|
#include <drogon/HttpController.h>
|
|
|
|
using namespace drogon;
|
|
|
|
namespace wizardmerge {
|
|
namespace controllers {
|
|
|
|
/**
|
|
* @brief HTTP controller for three-way merge API
|
|
*/
|
|
class MergeController : public HttpController<MergeController> {
|
|
public:
|
|
METHOD_LIST_BEGIN
|
|
// POST /api/merge - Perform three-way merge
|
|
ADD_METHOD_TO(MergeController::merge, "/api/merge", Post);
|
|
METHOD_LIST_END
|
|
|
|
/**
|
|
* @brief Perform three-way merge operation
|
|
*
|
|
* Request body should be JSON:
|
|
* {
|
|
* "base": ["line1", "line2", ...],
|
|
* "ours": ["line1", "line2", ...],
|
|
* "theirs": ["line1", "line2", ...]
|
|
* }
|
|
*
|
|
* Response:
|
|
* {
|
|
* "merged": ["line1", "line2", ...],
|
|
* "conflicts": [...]
|
|
* }
|
|
*/
|
|
void merge(const HttpRequestPtr &req,
|
|
std::function<void(const HttpResponsePtr &)> &&callback);
|
|
};
|
|
|
|
} // namespace controllers
|
|
} // namespace wizardmerge
|
|
|
|
#endif // WIZARDMERGE_CONTROLLERS_MERGE_CONTROLLER_H
|