/* * @Description: * @Version: 1.0 * @Autor: lishengyin * @Date: 2022-02-15 15:15:51 * @LastEditors: lishengyin * @LastEditTime: 2022-02-16 09:12:37 */ #ifndef __PALYRLOGIN_H_ #define __PALYRLOGIN_H_ #include #include #include #include #include using namespace std; class PlayerLogin { private: std::string URL = "/manager.do"; public: std::string cid; std::string ctype; std::string cname; std::string cpwd; public: PlayerLogin(); ~PlayerLogin(); void setURL(std::string url){ this->URL = url; } std::string getUrl(){ return this->URL; } void objectToJson(std::string& str){ rapidjson::StringBuffer strBuf; rapidjson::Writer writer(strBuf); this->objectToJson(writer); str = strBuf.GetString(); } void objectToJson(rapidjson::Writer& writer){ writer.StartObject(); writer.Key("cid"); writer.String(cid.c_str()); writer.Key("ctype"); writer.String(ctype.c_str()); writer.Key("cname"); writer.String(cname.c_str()); writer.Key("cpwd"); writer.String(cpwd.c_str()); writer.EndObject(); } }; #endif