NettyHttpDicCode.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * @Description:
  3. * @Version: 1.0
  4. * @Autor: lishengyin
  5. * @Date: 2022-03-02 09:41:56
  6. * @LastEditors: lishengyin
  7. * @LastEditTime: 2022-03-03 16:34:43
  8. */
  9. #ifndef __NETTYHTTPDISCODE_H_
  10. #define __NETTYHTTPDISCODE_H_
  11. #include <iostream>
  12. #include <rapidjson/document.h>
  13. #include <rapidjson/rapidjson.h>
  14. #include <rapidjson/stringbuffer.h>
  15. #include <rapidjson/writer.h>
  16. using namespace std;
  17. class NettyHttpDicCode
  18. {
  19. public:
  20. std::string addTime;
  21. int appId;
  22. std::string attr1;
  23. std::string attr2;
  24. std::string attr3;
  25. int createBy;
  26. std::string dictCode;
  27. int dictId;
  28. std::string dictName;
  29. int dictType;
  30. int enableFlag;
  31. int orderNo;
  32. std::string parentDictCode;
  33. std::string parentDictName;
  34. std::string remark;
  35. int updateBy;
  36. std::string updateTime;
  37. public:
  38. NettyHttpDicCode(){}
  39. ~NettyHttpDicCode(){}
  40. /**
  41. * @description: json反序列为对象
  42. * @param {*}
  43. * @return {*}
  44. */
  45. bool jsonToObject(const rapidjson::Value& object){
  46. const auto end = object.MemberEnd();
  47. if(end == object.FindMember("attr1") || !object["attr1"].IsString()){
  48. return false;
  49. }else{
  50. attr1 = object["attr1"].GetString();
  51. }
  52. return true;
  53. }
  54. };
  55. #endif