FromWebAPI.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 saveTemplateList(const QMap<OneTemplateInfo, QList<OnePlanItemInfo>>& mapTemplate);
  41. /* 获取模板内容 */
  42. bool getOneTemplateData(OneTemplateInfo tmpInfo, QList<OnePlanItemInfo>& list);
  43. /* 获取多个模板的内容 */
  44. bool getTemplateData(QList<OneTemplateInfo>& listTemplate, QMap<int, QList<OnePlanItemInfo>>& mapPlan);
  45. /* 获取模板列表 */
  46. bool getTemplateList(QMultiMap<int, OneTemplateInfo>& mapTemplate);
  47. /* 获取某个频率的模版列表 */
  48. bool getTemplateList(int chnID, QList<OneTemplateInfo>& listTemplate);
  49. /* 删除一个模板 */
  50. bool deleteTemplate(const OneTemplateInfo& info);
  51. /* 一次删除多个模版 */
  52. bool deleteTemplateList(const QList<OneTemplateInfo>& listTemplate);
  53. /* 修改模版 */
  54. bool modifyTemplate(const OneTemplateInfo& info, QList<OnePlanItemInfo>& list);
  55. /* 批量修改模版 */
  56. bool modifyTemplateList(const QMap<OneTemplateInfo, QList<OnePlanItemInfo>>& mapTemplate);
  57. /* 更新模板名称 */
  58. bool updateTemplateName(const QMap<OneTemplateInfo, QString>& mapTemplateName);
  59. private:
  60. lhhttpapi* m_httpApi = nullptr;
  61. QString m_userToken;
  62. };
  63. #endif /* FROMWEBAPI_H */