#ifndef FROMWEBAPI_H
#define FROMWEBAPI_H

#include "lhhttpapi.h"
#include "TransmitterSwitchInfo.h"

struct ExecPlanItemInfo;

class FromWebAPI
{
public:
    FromWebAPI();
    ~FromWebAPI();

    /* 初始化WebAPI */
    bool initWebApi(const QString& url,const QString& serverID,const QString& serverKey);
    
    /* 获取设备信息 */
    bool getDeviceInfo(QMap<QString, DeviceInfo>& mapDevice);

    /* 将数据写入EQM数据库 */
    bool insertData(QList<ExecPlanItemInfo>& list);
    /* 获取tExecPlan表格数据 */
    bool getExecPlanData(QList<ExecPlanItemInfo>& list);

    /* 获取EQM数据库中的模版编号 */
    bool getEQMTemplateID(QList<int>& listId);
    /* 删除所有行 */
    bool deleteAllRow();

private:

    lhhttpapi* m_httpApi = nullptr;
    QString m_userToken;
};


#endif /* FROMWEBAPI_H */