refactor: service folder structure
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
#include "TaskManager.h"
|
||||
|
||||
// Services
|
||||
#include "NodeService.h"
|
||||
#include "NetworkService.h"
|
||||
#include "ClusterService.h"
|
||||
#include "TaskService.h"
|
||||
#include "services/NodeService.h"
|
||||
#include "services/NetworkService.h"
|
||||
#include "services/ClusterService.h"
|
||||
#include "services/TaskService.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include "TaskManager.h"
|
||||
#include "NeoPattern.cpp"
|
||||
#include <map>
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "TaskManager.h"
|
||||
|
||||
// Services
|
||||
#include "NodeService.h"
|
||||
#include "NetworkService.h"
|
||||
#include "ClusterService.h"
|
||||
#include "TaskService.h"
|
||||
#include "services/NodeService.h"
|
||||
#include "services/NetworkService.h"
|
||||
#include "services/ClusterService.h"
|
||||
#include "services/TaskService.h"
|
||||
#include "NeoPatternService.h"
|
||||
|
||||
#ifndef LED_STRIP_PIN
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include "TaskManager.h"
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#include <map>
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "TaskManager.h"
|
||||
|
||||
// Services
|
||||
#include "NodeService.h"
|
||||
#include "NetworkService.h"
|
||||
#include "ClusterService.h"
|
||||
#include "TaskService.h"
|
||||
#include "services/NodeService.h"
|
||||
#include "services/NetworkService.h"
|
||||
#include "services/ClusterService.h"
|
||||
#include "services/TaskService.h"
|
||||
#include "NeoPixelService.h"
|
||||
|
||||
#ifndef NEOPIXEL_PIN
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include "TaskManager.h"
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "TaskManager.h"
|
||||
|
||||
// Services
|
||||
#include "NodeService.h"
|
||||
#include "NetworkService.h"
|
||||
#include "ClusterService.h"
|
||||
#include "TaskService.h"
|
||||
#include "services/NodeService.h"
|
||||
#include "services/NetworkService.h"
|
||||
#include "services/ClusterService.h"
|
||||
#include "services/TaskService.h"
|
||||
#include "RelayService.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#include "ClusterManager.h"
|
||||
|
||||
// Services
|
||||
#include "NodeService.h"
|
||||
#include "ClusterService.h"
|
||||
#include "TaskService.h"
|
||||
#include "NetworkService.h"
|
||||
#include "services/NodeService.h"
|
||||
#include "services/ClusterService.h"
|
||||
#include "services/TaskService.h"
|
||||
#include "services/NetworkService.h"
|
||||
|
||||
NodeContext ctx({
|
||||
{"app", "network"},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include "NodeContext.h"
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include "NetworkManager.h"
|
||||
#include "NodeContext.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include "NodeContext.h"
|
||||
#include <ArduinoJson.h>
|
||||
#include <Updater.h>
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include "TaskManager.h"
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[platformio]
|
||||
;default_envs = esp01_1m
|
||||
default_envs = esp01_1m
|
||||
src_dir = .
|
||||
|
||||
[common]
|
||||
@@ -32,6 +32,7 @@ build_src_filter =
|
||||
+<examples/base/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:d1_mini]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -46,6 +47,7 @@ build_src_filter =
|
||||
+<examples/base/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:esp01_1m_relay]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -61,6 +63,7 @@ build_src_filter =
|
||||
+<examples/relay/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:esp01_1m_neopixel]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -77,6 +80,7 @@ build_src_filter =
|
||||
+<examples/neopixel/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:d1_mini_neopixel]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -92,6 +96,7 @@ build_src_filter =
|
||||
+<examples/neopixel/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:esp01_1m_neopattern]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -109,6 +114,7 @@ build_src_filter =
|
||||
+<examples/neopattern/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:esp01_1m_wifiscan]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -124,6 +130,7 @@ build_src_filter =
|
||||
+<examples/wifiscan/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:d1_mini_wifiscan]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -138,6 +145,7 @@ build_src_filter =
|
||||
+<examples/wifiscan/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
[env:d1_mini_neopattern]
|
||||
platform = platformio/espressif8266@^4.2.1
|
||||
@@ -153,3 +161,4 @@ build_src_filter =
|
||||
+<examples/neopattern/*.cpp>
|
||||
+<src/*.c>
|
||||
+<src/*.cpp>
|
||||
+<src/services/*.cpp>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "ApiServer.h"
|
||||
#include "Service.h"
|
||||
#include "services/Service.h"
|
||||
#include <algorithm>
|
||||
|
||||
const char* ApiServer::methodToStr(int method) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "ClusterService.h"
|
||||
#include "services/ClusterService.h"
|
||||
#include "ApiServer.h"
|
||||
|
||||
ClusterService::ClusterService(NodeContext& ctx) : ctx(ctx) {}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "NetworkService.h"
|
||||
#include "services/NetworkService.h"
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
NetworkService::NetworkService(NetworkManager& networkManager)
|
||||
@@ -10,7 +10,7 @@ void NetworkService::registerEndpoints(ApiServer& api) {
|
||||
[this](AsyncWebServerRequest* request) { handleWifiScanRequest(request); },
|
||||
std::vector<ParamSpec>{});
|
||||
|
||||
api.addEndpoint("/api/network/wifi/networks", HTTP_GET,
|
||||
api.addEndpoint("/api/network/wifi/scan", HTTP_GET,
|
||||
[this](AsyncWebServerRequest* request) { handleGetWifiNetworks(request); },
|
||||
std::vector<ParamSpec>{});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "NodeService.h"
|
||||
#include "services/NodeService.h"
|
||||
#include "ApiServer.h"
|
||||
|
||||
NodeService::NodeService(NodeContext& ctx) : ctx(ctx) {}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "TaskService.h"
|
||||
#include "services/TaskService.h"
|
||||
#include "ApiServer.h"
|
||||
#include <algorithm>
|
||||
|
||||
Reference in New Issue
Block a user