FromWebAPI.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef FROMWEBAPI_H
  2. #define FROMWEBAPI_H
  3. #include "lhhttpapi.h"
  4. #include "TransmitterSwitchInfo.h"
  5. #include <qlist.h>
  6. struct OnePlanItemInfo;
  7. class FromWebAPI
  8. {
  9. public:
  10. FromWebAPI();
  11. ~FromWebAPI();
  12. /* 初始化WebAPI */
  13. bool initWebApi(const QString& url,const QString& serverID,const QString& serverKey);
  14. /* 获取设备信息 */
  15. bool getDeviceInfo(QMap<QString, DeviceInfo>& mapDevice);
  16. /* 获取频率信息 */
  17. bool getChannelInfo(QMap<int, ChannelInfo>& mapFreq);
  18. /* 将数据写入EQM数据库 */
  19. bool insertData(int chnID, QList<OnePlanItemInfo>& list);
  20. /* 获取tExecPlan表格数据 */
  21. bool getExecPlanData(int chnID, QList<OnePlanItemInfo>& list);
  22. bool getExecPlanData(QMap<int, QList<OnePlanItemInfo>>& mapPlan);
  23. /* 删除所有行 */
  24. bool deleteAllRow();
  25. /* 删除一个发射机计划 */
  26. bool deleteOneChnPlan(int chnID);
  27. /* 将页面的配置写入数据库 */
  28. bool insertConfigData(QMap<int, ConfigData>& list);
  29. /* 删除配置数据 */
  30. bool deleteConfigData(QMap<int, ConfigData>& list);
  31. /* 获取配置数据 */
  32. bool getConfigData(QMap<int, ConfigData>& list);
  33. /* 单独获取某个关键字的数据 */
  34. bool getConfigData(int key, ConfigData& data);
  35. /* 获取EQM数据库中的模版编号 */
  36. bool getEQMTemplateID(QList<int>& listId);
  37. /* 保存到模板 */
  38. bool saveTemplate(const QString& templateName, QList<OnePlanItemInfo>& list);
  39. /* 获取模板内容 */
  40. bool getOneTemplateData(QString templateName, QList<OnePlanItemInfo>& list);
  41. /* 获取多个模板的内容 */
  42. bool getTemplateData(QList<OneTemplateInfo>& listTemplate, QMap<int, QList<OnePlanItemInfo>>& mapPlan);
  43. /* 获取模板列表 */
  44. bool getTemplateList(QMultiMap<int, OneTemplateInfo>& mapTemplate);
  45. /* 获取某个频率的模版列表 */
  46. bool getTemplateList(int chnID, QList<OneTemplateInfo>& listTemplate);
  47. /* 删除一个模板 */
  48. bool deleteTemplate(const QString& name);
  49. private:
  50. lhhttpapi* m_httpApi = nullptr;
  51. QString m_userToken;
  52. };
  53. #endif /* FROMWEBAPI_H */