houseinfo.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * houseinfo.h
  3. *
  4. * Created on: 2022年5月27日
  5. * Author: dingxy
  6. */
  7. #ifndef JNI_CORE_HOUSEINFO_H_
  8. #define JNI_CORE_HOUSEINFO_H_
  9. #include "base/strings.hpp"
  10. namespace j {
  11. struct house_setting{
  12. std::string UserID;
  13. std::string UserPassword;
  14. std::string Token;
  15. std::string code;
  16. std::string name;
  17. std::string replace;
  18. std::string password;
  19. std::string community;
  20. std::string communityId;
  21. int communitycode;
  22. std::string area;
  23. std::string areaId;
  24. int areacode;
  25. std::string build;
  26. std::string buildId;
  27. int buildcode;
  28. std::string unit;
  29. std::string unitId;
  30. int unitcode;
  31. std::string floor;
  32. std::string floorId;
  33. int floorcode;
  34. std::string room;
  35. std::string roomId;
  36. int roomcode;
  37. public:
  38. house_setting() {
  39. code = "";
  40. name = "";
  41. replace = "false";
  42. password = "";
  43. community = "";
  44. communityId = "";
  45. communitycode = 0;
  46. area = "";
  47. areaId = "";
  48. areacode = 0;
  49. build = "";
  50. buildId = "";
  51. buildcode = 0;
  52. unit = "";
  53. unitId = "";
  54. unitcode = 0;
  55. floor = "";
  56. floorId = "";
  57. floorcode = 0;
  58. room = "";
  59. roomId = "";
  60. roomcode = 0;
  61. }
  62. std::string ToAddressString() const {
  63. return base::format("%s %s %s层 %s室", build.c_str(), unit.c_str(), floor.c_str(), room.c_str());
  64. }
  65. std::string ToWuyeString() const {
  66. return base::format("MN-%d-0-0-0-0-1", communitycode);
  67. }
  68. std::string ToUserString() const {
  69. return base::format("RM-%d-%d-%d-%d-%d-%d", communitycode, areacode, buildcode, unitcode, floorcode, roomcode);
  70. }
  71. std::string ToDoorPartString() const {
  72. return base::format("OD-%d-%d-%d-%d-0-", communitycode, areacode, buildcode, unitcode);
  73. }
  74. };
  75. };
  76. #endif /* JNI_CORE_HOUSEINFO_H_ */