NettyExpelDevInfo.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * @Description:
  3. * @Version: 1.0
  4. * @Autor: lishengyin
  5. * @Date: 2022-02-28 15:13:15
  6. * @LastEditors: lishengyin
  7. * @LastEditTime: 2022-02-28 15:40:58
  8. */
  9. #ifndef ___NETTYEXPELDEVINFO_H_
  10. #define ___NETTYEXPELDEVINFO_H_
  11. #include <iostream>
  12. using namespace std;
  13. #include <rapidjson/document.h>
  14. #include <rapidjson/rapidjson.h>
  15. #include <rapidjson/stringbuffer.h>
  16. #include <rapidjson/writer.h>
  17. class NettyExpelDevInfo
  18. {
  19. public:
  20. std::string addTime;
  21. int appId;
  22. int areaDetailId;
  23. int areaId;
  24. std::string attr1;
  25. std::string attr2;
  26. std::string attr3;
  27. int batteryStatus;
  28. std::string birdDeviceCode;
  29. std::string coX;
  30. std::string coY;
  31. std::string coZ;
  32. int createBy;
  33. int deviceControlType;
  34. std::string deviceDataAttr1;
  35. std::string deviceDataAttr2;
  36. std::string deviceDataAttr3;
  37. std::string deviceMac;
  38. std::string deviceName;
  39. std::string deviceNum;
  40. std::string devicePassWord;
  41. int deviceSource;
  42. int deviceSubType;
  43. int deviceType;
  44. std::string deviceUserName;
  45. std::string deviceUuid;
  46. int dvId;
  47. int enableFlag;
  48. int gasPressure;
  49. std::string groupAreaName;
  50. std::string groupField;
  51. std::string imgUrl;
  52. std::string latitude;
  53. std::string linkDvId;
  54. std::string localIp;
  55. std::string longitude;
  56. std::string name;
  57. int num;
  58. int oxyPressure;
  59. int parentDvId;
  60. std::string parentDvName;
  61. std::string place;
  62. int port;
  63. int powerStatus;
  64. std::string remark;
  65. int status;
  66. std::string stream;
  67. int subCol;
  68. std::string subName;
  69. int subRow;
  70. int updateBy;
  71. std::string updateTime;
  72. int uploadId;
  73. int workStatus;
  74. public:
  75. NettyExpelDevInfo(){}
  76. ~NettyExpelDevInfo(){}
  77. /**
  78. * @description: json反序列为对象
  79. * @param {*}
  80. * @return {*}
  81. */
  82. bool jsonToObject(const rapidjson::Value& object){
  83. const auto end = object.MemberEnd();
  84. if(end == object.FindMember("birdDeviceCode") || !object["birdDeviceCode"].IsString()){
  85. return false;
  86. }else{
  87. birdDeviceCode = object["birdDeviceCode"].GetString();
  88. }
  89. if(end == object.FindMember("deviceControlType") || !object["deviceControlType"].IsInt()){
  90. return false;
  91. }else{
  92. deviceControlType = object["deviceControlType"].GetInt();
  93. }
  94. if(end == object.FindMember("deviceType") || !object["deviceType"].IsInt()){
  95. return false;
  96. }else{
  97. deviceType = object["deviceType"].GetInt();
  98. }
  99. return true;
  100. }
  101. };
  102. #endif