HttpPrcess.h 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include <httplib.h>
  3. #include "AlarmDefine.h"
  4. #define IS_NULL(x) (x ? x : "")
  5. void DealHttpGet(const httplib::Request& req, httplib::Response& res);
  6. void DealHttpPost(const httplib::Request& req, httplib::Response& res);
  7. //SVG
  8. int DealPostSvgData(const httplib::Request& req,const string token, httplib::Response& res);
  9. int DealGetSvgData(const httplib::Request& req, const string token, httplib::Response& res);
  10. int DealOptionSvgData(const httplib::Request& req, const string token, httplib::Response& res);
  11. //获取站场图状态
  12. int DealGetMpStat(const httplib::Request& req, const string token, httplib::Response& res);
  13. int DealGetMitieLock(const httplib::Request& req, const string token, char** json, size_t* json_len);
  14. int DealGetConvertResist(const httplib::Request& req, const string token, char** json, size_t* json_len);
  15. int DealGetRetesionForce(const httplib::Request& req, const string token, char** json, size_t* json_len);
  16. //获取日曲线
  17. int DealGetResistCurve(const httplib::Request& req, const string token, char** json, size_t* json_len);
  18. int DealGetRetentionCurve(const httplib::Request& req, const string token, char** json, size_t* json_len);
  19. //获取日报表
  20. int DealGetResistReport(const httplib::Request& req, const string token, char** json, size_t* json_len);
  21. int DealGetRetentionReport(const httplib::Request& req, const string token, char** json, size_t* json_len);
  22. //获取扳动信息
  23. int DealGetMoveInfo(const httplib::Request& req, const string token, char** json, size_t* json_len);
  24. int DealResistMove(const httplib::Request& req, const string token, char** json, size_t* json_len);
  25. //上传升级文件
  26. int DealPostBinData(const httplib::Request& req, const string token, httplib::Response& res);
  27. int DealPostMitieLock(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  28. int DealPostConvertResist(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  29. int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  30. //浏览记录
  31. int DealPostCommitRecord(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  32. int DealGetOptLog(const httplib::Request& req, const string token, char** json, size_t* json_len);
  33. int ExecSqlForRecord(eRecord_Module module, int dura, uint8_t analyze_type, string& strStation, string& strStationName, const char* mo, const char* mo_name, const char* mp, const char* mp_name,
  34. uint64_t start_time, uint64_t end_time, time_t tt, string& strName, const char* username, eRocord_Opt opt, string& mark);
  35. //参考曲线
  36. int DealGetrefer_option(const httplib::Request& req, const string token, char** json, size_t* json_len);
  37. int DealGetrefer_curve(const httplib::Request& req, const string token, char** json, size_t* json_len);
  38. int DealPostrefer_curve(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  39. int WriteReferFile(const string& station, const string& mo, const string& mp, uint8_t posi,
  40. const std::map<time_t, int>& data0, const std::map<time_t, int>& data1, const std::map<time_t, int>& data2, OUT string& msg);
  41. int ReadReferFile(const string& station, const string& mo, const string& mp, uint8_t posi, time_t show_time, yyjson_mut_doc* mut_doc,
  42. yyjson_mut_val* arr, OUT string& msg);
  43. //报警
  44. int deal_get_reminder_interval(const httplib::Request& req, const string token, char** json, size_t* json_len);
  45. int deal_post_reminder_interval(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  46. int deal_get_alarm_list(const httplib::Request& req, const string token, char** json, size_t* json_len);
  47. //历史数据
  48. int DealGetResistData(const httplib::Request& req, const string token, char** json, size_t* json_len);