HttpPrcess.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. void DealHttpPut(const httplib::Request& req, httplib::Response& res);
  8. //SVG
  9. int DealPostSvgData(const httplib::Request& req,const string token, httplib::Response& res);
  10. int DealGetSvgData(const httplib::Request& req, const string token, httplib::Response& res);
  11. int DealOptionSvgData(const httplib::Request& req, const string token, httplib::Response& res);
  12. //获取站场图状态
  13. int DealGetMpStat(const httplib::Request& req, const string token, httplib::Response& res);
  14. int DealGetMitieLock(const httplib::Request& req, const string token, char** json, size_t* json_len);
  15. int DealGetConvertResist(const httplib::Request& req, const string token, char** json, size_t* json_len);
  16. int DealGetRetesionForce(const httplib::Request& req, const string token, char** json, size_t* json_len);
  17. //获取日曲线
  18. int DealGetResistCurve(const httplib::Request& req, const string token, char** json, size_t* json_len);
  19. int DealGetRetentionCurve(const httplib::Request& req, const string token, char** json, size_t* json_len);
  20. //获取日报表
  21. int DealGetResistReport(const httplib::Request& req, const string token, char** json, size_t* json_len);
  22. int DealGetRetentionReport(const httplib::Request& req, const string token, char** json, size_t* json_len);
  23. //获取扳动信息
  24. int DealGetMoveInfo(const httplib::Request& req, const string token, char** json, size_t* json_len);
  25. int DealResistMove(const httplib::Request& req, const string token, char** json, size_t* json_len);
  26. //上传升级文件
  27. int DealPostBinData(const httplib::Request& req, const string token, httplib::Response& res);
  28. int DealPostMitieLock(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  29. int DealPostConvertResist(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  30. int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  31. //浏览记录
  32. int DealPostCommitRecord(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  33. int DealGetOptLog(const httplib::Request& req, const string token, char** json, size_t* json_len);
  34. 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,
  35. uint64_t start_time, uint64_t end_time, time_t tt, string& strName, const char* username, eRocord_Opt opt, string& mark);
  36. //参考曲线
  37. int DealGetrefer_option(const httplib::Request& req, const string token, char** json, size_t* json_len);
  38. int DealGetrefer_curve(const httplib::Request& req, const string token, char** json, size_t* json_len);
  39. int DealPostrefer_curve(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  40. int WriteReferFile(const string& station, const string& mo, const string& mp, uint8_t posi,
  41. const std::map<time_t, int>& data0, const std::map<time_t, int>& data1, const std::map<time_t, int>& data2, OUT string& msg);
  42. int ReadReferFile(const string& station, const string& mo, const string& mp, uint8_t posi, time_t show_time, yyjson_mut_doc* mut_doc,
  43. yyjson_mut_val* arr, OUT string& msg);
  44. //报警
  45. int deal_get_reminder_interval(const httplib::Request& req, const string token, char** json, size_t* json_len);
  46. int deal_post_reminder_interval(const char* body_ptr, const size_t body_len, const string token, char** json, size_t* json_len);
  47. int deal_get_alarm_list(const httplib::Request& req, const string token, char** json, size_t* json_len);
  48. //历史数据
  49. int DealGetResistData(const httplib::Request& req, const string token, char** json, size_t* json_len);
  50. //修改转辙机编号
  51. int DealPutChangeZzjno(const char* body_ptr, const size_t body_len, const string token, char** json, size_t *json_len);