123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /*
- * @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 <iostream>
- #include <rapidjson/document.h>
- #include <rapidjson/rapidjson.h>
- #include <rapidjson/stringbuffer.h>
- #include <rapidjson/writer.h>
- 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<rapidjson::StringBuffer> writer(strBuf);
- this->objectToJson(writer);
- str = strBuf.GetString();
- }
- void objectToJson(rapidjson::Writer<rapidjson::StringBuffer>& 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
|