🪄 Formats APStatus
This commit is contained in:
@@ -14,25 +14,17 @@
|
|||||||
|
|
||||||
#include <APStatus.h>
|
#include <APStatus.h>
|
||||||
|
|
||||||
APStatus::APStatus(PsychicHttpServer *server,
|
APStatus::APStatus(PsychicHttpServer *server, SecurityManager *securityManager, APSettingsService *apSettingsService)
|
||||||
SecurityManager *securityManager,
|
: _server(server), _securityManager(securityManager), _apSettingsService(apSettingsService) {}
|
||||||
APSettingsService *apSettingsService) : _server(server),
|
void APStatus::begin() {
|
||||||
_securityManager(securityManager),
|
_server->on(AP_STATUS_SERVICE_PATH, HTTP_GET,
|
||||||
_apSettingsService(apSettingsService)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void APStatus::begin()
|
|
||||||
{
|
|
||||||
_server->on(AP_STATUS_SERVICE_PATH,
|
|
||||||
HTTP_GET,
|
|
||||||
_securityManager->wrapRequest(std::bind(&APStatus::apStatus, this, std::placeholders::_1),
|
_securityManager->wrapRequest(std::bind(&APStatus::apStatus, this, std::placeholders::_1),
|
||||||
AuthenticationPredicates::IS_AUTHENTICATED));
|
AuthenticationPredicates::IS_AUTHENTICATED));
|
||||||
|
|
||||||
ESP_LOGV("APStatus", "Registered GET endpoint: %s", AP_STATUS_SERVICE_PATH);
|
ESP_LOGV("APStatus", "Registered GET endpoint: %s", AP_STATUS_SERVICE_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t APStatus::apStatus(PsychicRequest *request)
|
esp_err_t APStatus::apStatus(PsychicRequest *request) {
|
||||||
{
|
|
||||||
PsychicJsonResponse response = PsychicJsonResponse(request, false);
|
PsychicJsonResponse response = PsychicJsonResponse(request, false);
|
||||||
JsonObject root = response.getRoot();
|
JsonObject root = response.getRoot();
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,7 @@
|
|||||||
|
|
||||||
#define AP_STATUS_SERVICE_PATH "/api/apStatus"
|
#define AP_STATUS_SERVICE_PATH "/api/apStatus"
|
||||||
|
|
||||||
class APStatus
|
class APStatus {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
APStatus(PsychicHttpServer *server, SecurityManager *securityManager, APSettingsService *apSettingsService);
|
APStatus(PsychicHttpServer *server, SecurityManager *securityManager, APSettingsService *apSettingsService);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user