79 lines
2.4 KiB
C++
79 lines
2.4 KiB
C++
|
|
/**********************************************************************************
|
|
* @file SimpleCtrl.hpp
|
|
* @brief 使用oatpp简单api的控制器类
|
|
* @author yikenan
|
|
* @versiong 1.0
|
|
* @date 2021/12/27
|
|
**********************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
#include "oatpp/web/server/api/ApiController.hpp"
|
|
#include "oatpp/core/macro/codegen.hpp"
|
|
#include "oatpp/core/macro/component.hpp"
|
|
|
|
#include OATPP_CODEGEN_BEGIN( ApiController )
|
|
|
|
namespace web_server
|
|
{
|
|
namespace module_alarm
|
|
{
|
|
|
|
/**
|
|
* 使用oatpp简单api的控制器类
|
|
*/
|
|
class CSimpleCtrl final : public oatpp::web::server::api::ApiController
|
|
{
|
|
public:
|
|
explicit CSimpleCtrl( OATPP_COMPONENT( std::shared_ptr<ObjectMapper>, objMapper ));
|
|
|
|
~CSimpleCtrl() override = default;
|
|
|
|
public:
|
|
ENDPOINT( "POST", "findAlarmcolor", findAlarmcolor );
|
|
|
|
ENDPOINT( "POST", "insertColor", insertColor, BODY_STRING( String, strReq ));
|
|
|
|
ENDPOINT( "GET", "queryEventMsFromMySql", queryEventMsFromMySql, QUERY( String, content ),
|
|
QUERY( String, priority ), QUERY( String, location ), QUERY( String, devType ), QUERY( String, type ),
|
|
QUERY( String, regionId ), QUERY( String, startTime ), QUERY( String, endTime ),
|
|
QUERY( Int32, orderType ), QUERY( String, orderFlag ), QUERY( Int16, pageSize ), QUERY( Int16, page )
|
|
);
|
|
|
|
ENDPOINT( "GET", "queryAlarmTreeMs", queryAlarmTreeMs,
|
|
REQUEST( std::shared_ptr<IncomingRequest>, spRequest ));
|
|
|
|
ENDPOINT( "GET", "queryEventConditionMs", queryEventConditionMs,
|
|
/*QUERY( Int32 , type ), QUERY( Int32, id ),*/REQUEST( std::shared_ptr<IncomingRequest>, spRequest ));
|
|
|
|
/**
|
|
* @brief 告警级别告警时间统计
|
|
*/
|
|
ENDPOINT( "GET", "/api-query/databind/getAlarmLevelCount", getAlarmLevelCount,
|
|
REQUEST( std::shared_ptr<IncomingRequest>, spRequest ));
|
|
|
|
/**
|
|
* @brief 获得全部告警
|
|
*/
|
|
ENDPOINT( "GET", "getAllAlm", getAllAlm);
|
|
/**
|
|
* @brief 获得版本vetsion_no之后的告警
|
|
*/
|
|
ENDPOINT( "GET", "getChgLogAfter", getChgLogAfter, QUERY( Int32, version_no ));
|
|
|
|
|
|
/**
|
|
* @brief 机柜告警统计
|
|
*/
|
|
// ENDPOINT( "GET", "/api-query/databind/getDeviceAlarmById", getDeviceAlarmById ,
|
|
// REQUEST( std::shared_ptr<IncomingRequest>, spRequest ));
|
|
};
|
|
|
|
} //namespace module_alarm
|
|
} //namespace web_server
|
|
|
|
#include OATPP_CODEGEN_END( ApiController )
|
|
|
|
|