复现已有算法

This commit is contained in:
cloud
2026-07-14 15:43:18 +08:00
parent abebd2a683
commit 50b8111fd9
860 changed files with 182250 additions and 18 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <drogon/drogon.h>
#include <trantor/utils/Logger.h>
#include <memory>
#include "controllers/WindPowerController.h"
using namespace drogon;
int main() {
// 抑制 Drogon/trantor 内部日志噪声
trantor::Logger::setLogLevel(trantor::Logger::kFatal);
// 加载 Drogon 配置(监听端口 / CORS / 静态资源根目录)
LOG_INFO << "Loading server configuration...";
app().loadConfigFile("config/server_config.json");
app().registerController(std::make_shared<WindPowerController>());
// SPA 前端路由回退:未匹配路径统一返回 index.html,交由前端路由处理
app().setCustom404Page(
HttpResponse::newFileResponse("./web/index.html", "", CT_TEXT_HTML),
false);
LOG_INFO << "wind_server starting...";
// 阻塞运行,直到收到 SIGINT/SIGTERM
app().run();
LOG_INFO << "wind_server stopped";
return 0;
}