完成系统管理web端功能,实现系统管理服务端接口,实现登录功能

This commit is contained in:
lixiaoyuan
2025-07-18 09:08:09 +08:00
parent 4a198a7271
commit 7b3f32f334
31 changed files with 1384 additions and 325 deletions

View File

@@ -1,7 +1,54 @@
#pragma once
#include <string>
#include <map>
#include <vector>
#include <memory>
#include <common/DataFields.h>
class CommEntity;
class DeviceEntity
{
public:
int deviceId = -1;
int type = -1;
std::string name;
std::string code;
bool isOpen = false;
std::string attrsJson = "";
int err = 0;
int online = 0;
int status = 0;
//std::map<std::string, std::string> mapAttrs;
DataFields attrs;
// 通讯entity
std::shared_ptr<CommEntity> commEntity;
//int getAttrInt(std::string key);
//float getAttrFloat(std::string key);
//double getAttrDouble(std::string key);
//std::string getAttrStr(std::string key);
// 启动通讯
int startComm();
};
class Device
{
public:
static bool init();
};
static void add(DataFields& fields);
static std::vector<std::shared_ptr<DeviceEntity>> getDeviceByType(int type);
public:
static std::map<int, std::shared_ptr<DeviceEntity>> mapDevices;
};