2025-07-18 09:08:09 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
|
|
struct DatabaseOption
|
|
|
|
|
|
{
|
|
|
|
|
|
std::string host;
|
|
|
|
|
|
int port;
|
|
|
|
|
|
std::string user;
|
|
|
|
|
|
std::string passwd;
|
|
|
|
|
|
std::string dbname;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct AppOption
|
|
|
|
|
|
{
|
|
|
|
|
|
DatabaseOption database;
|
2025-09-01 20:08:40 +08:00
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
|
bool useToken {true};
|
|
|
|
|
|
int port {0};
|
|
|
|
|
|
} http;
|
|
|
|
|
|
|
2025-09-04 19:31:04 +08:00
|
|
|
|
struct {
|
|
|
|
|
|
std::string host;
|
|
|
|
|
|
std::string username;
|
|
|
|
|
|
std::string password;
|
|
|
|
|
|
} mqtt;
|
|
|
|
|
|
|
2025-09-08 19:34:12 +08:00
|
|
|
|
std::string webSrvUrl;
|
|
|
|
|
|
|
2025-07-18 09:08:09 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Config
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
static bool init(std::string filename);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static AppOption option;
|
|
|
|
|
|
};
|