#ifndef _BRIGHTNESSINFO_H_ #define _BRIGHTNESSINFO_H_ #include "IHttpFunc.h" #include "json/json.h" #include "SpBase.h" #ifndef RVC_UPDATE_CAMERABRIGHNESS_HTTP_API #define RVC_UPDATE_CAMERABRIGHNESS_HTTP_API "/api/unify/config/alter/exposure" #endif // !RVC_UPDATE_CAMERABRIGHNESS_HTTP_API #ifndef RVC_HTTPTIMEOUT #define RVC_HTTPTIMEOUT 20 #endif // !RVC_HTTPTIMEOUT #define REFLECTION(var) #var typedef struct brightness_item_s { std::string module; std::string name; std::string value; }brightness_item_t; //brightness_info_t typedef struct brightness_info_s { CSimpleStringA strServerURL; CSimpleStringA strAPI; CSimpleStringA strTerminalNo; CSimpleStringA strAppVersion; CSimpleStringA strBranchNo; vector vBrightnessList; }brightness_info_t; struct BrightnessInfoHTTPReq : CHTTPReq { std::string m_reqContent; virtual string ToJson() { return m_reqContent; } }; struct BrightnessInfoHTTPRet : CHTTPRet { std::string m_request; bool m_success; std::string m_code; std::string m_message; std::string m_returnCode; std::string m_errorMsg; bool m_data; virtual bool Parse(string strData) { Json::Value root; Json::Reader reader; if (reader.parse(strData, root, false)) { m_success = root[REFLECTION(success)].asBool(); m_code = root[REFLECTION(code)].asString(); m_message = root[REFLECTION(message)].asString(); m_returnCode = root[REFLECTION(return_code)].asString(); m_errorMsg = root[REFLECTION(error_msg)].asString(); m_data = root[REFLECTION(data)].asBool(); } else { m_success = false; } return m_success; } }; int post_camera_brightness_info_list(unsigned int& uposttime, CSimpleStringA& errormsg, brightness_info_t* pinfo, int itimeout, bool bprintdbg); #endif