/* * @Description: * @Version: 1.0 * @Autor: lishengyin * @Date: 2021-11-03 14:08:44 * @LastEditors: lishengyin * @LastEditTime: 2022-10-09 09:14:16 */ #pragma once #include #include #include #include "Util/logger.h" #include "Util/NoticeCenter.h" #include "Poller/EventPoller.h" #include "Util/SqlPool.h" #include "Network/TcpClient.h" #include "Poller/Timer.h" #include "TCPClient.h" #include "inifile.h" #include "Notices.h" #include "md5.h" #include "NettyHttpResultMsg.h" #include "NettyHttpToken.h" #include "NettyHttpNull.h" #include "NettyHttpCarInfo.h" #include "NettyHttpPeakValleyConfig.h" #include "NettyHttpCrowdingDegreeConfig.h" #include "NettyHttpDeviceConfig.h" using namespace std; namespace MIVA { class HttpClient { private: // 用户名 std::string account; std::string pwd = "sunwin20211102"; // 固定16位私钥 std::string privateKey = "mwWAH2eUAAHodlRt"; // authToken std::string authToken = ""; // refreshToken std::string refreshToken = ""; public: HttpClient(); ~HttpClient(); /** * @description: 初始化 * @param {string} account * @param {string} url * @param {int} port * @return {*} */ int32_t Init(std::string account,std::string url, int port); /** * @description: 创建对象 * @param {*} * @return {*} */ static std::shared_ptr CreateNew(); /** * @description: 登录 * @param {*} * @return {*} */ int32_t LoginNetty(); /** * @description: 获取用户数据 * @param {*} * @return {*} */ int32_t GetUserData(); /** * @description: 获取峰谷配置列表 * @param {*} * @return {*} */ int32_t GetPeakValleyConfig(); /** * @description: 获取拥挤配置 * @param {*} * @return {*} */ int32_t GetCrowdingDegreeConfig(); /** * @description: 获取摄像头设置 * @param {*} * @return {*} */ int32_t GetVideoConfig(); /** * @description: 获取系统设置 * @param {*} * @return {*} */ int32_t GetSystemConfig(); /** * @description: 获取时间 * @param {char} *ctime * @return {*} */ static void getDataTime(char *ctime); /** * @description: 判断是否获取到Token * @param {*} * @return {*} */ bool alive(); }; } // namespace name