2025-07-18 09:08:09 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
2025-09-19 18:54:36 +08:00
|
|
|
|
#include <map>
|
2025-07-18 09:08:09 +08:00
|
|
|
|
#include <string>
|
|
|
|
|
|
|
2025-09-18 20:12:46 +08:00
|
|
|
|
struct AppOption
|
|
|
|
|
|
{
|
2025-09-19 18:54:36 +08:00
|
|
|
|
int debug {0};
|
|
|
|
|
|
std::string webSrvUrl;
|
|
|
|
|
|
std::string lunchDate;
|
|
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
|
std::string host;
|
|
|
|
|
|
int port;
|
|
|
|
|
|
std::string user;
|
|
|
|
|
|
std::string passwd;
|
|
|
|
|
|
std::string dbname;
|
|
|
|
|
|
} database;
|
2025-09-01 20:08:40 +08:00
|
|
|
|
|
|
|
|
|
|
struct {
|
2025-09-19 18:54:36 +08:00
|
|
|
|
int useToken {1};
|
2025-09-01 20:08:40 +08:00
|
|
|
|
int port {0};
|
2025-09-19 18:54:36 +08:00
|
|
|
|
int encryption {1};
|
|
|
|
|
|
std::string encryptKey;
|
2025-09-01 20:08:40 +08:00
|
|
|
|
} http;
|
|
|
|
|
|
|
2025-09-04 19:31:04 +08:00
|
|
|
|
struct {
|
|
|
|
|
|
std::string host;
|
|
|
|
|
|
std::string username;
|
|
|
|
|
|
std::string password;
|
|
|
|
|
|
} mqtt;
|
|
|
|
|
|
|
2025-09-19 18:54:36 +08:00
|
|
|
|
struct {
|
|
|
|
|
|
float latitude {0};
|
|
|
|
|
|
float longitude {0};
|
|
|
|
|
|
float altitude {0};
|
|
|
|
|
|
} view;
|
|
|
|
|
|
|
|
|
|
|
|
struct VideoInfo {
|
|
|
|
|
|
std::string host;
|
|
|
|
|
|
int port;
|
|
|
|
|
|
std::string user;
|
|
|
|
|
|
std::string passwd;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
std::map<std::string, VideoInfo> mapVideo;
|
2025-09-08 19:34:12 +08:00
|
|
|
|
|
2025-07-18 09:08:09 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Config
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
static bool init(std::string filename);
|
|
|
|
|
|
|
2025-09-19 18:54:36 +08:00
|
|
|
|
static AppOption::VideoInfo* getVideoInfo(std::string name);
|
2025-07-18 09:08:09 +08:00
|
|
|
|
|
|
|
|
|
|
static AppOption option;
|
|
|
|
|
|
};
|