#include "SPAServer.h" #include "spdlog/spdlog.h" #include "CurlHttp.h" #include #include "CurlFtp.h" SPAServer::SPAServer() { m_logger = spdlog::get("SPAServer"); if(m_logger == nullptr) { SPDLOG_ERROR("APAServer logger is nullptr"); return; } // m_fromSuperBrain.getToken(); // // m_fromSuperBrain.getTaskTypeList(); // m_fromRedis.setRedisIPAndPort("172.16.36.80", 32222); // m_fromRedis.setRedisPassword("Ff1z@TOFr^iwd%Ra"); // m_fromRedis.connectRedis(); // std::string value; // m_fromRedis.getRedisString("113:P100104000", value); // SPDLOG_LOGGER_INFO(m_logger, "{}", value); // m_fromRedis.disConnectRedis(); //|FTP|192.1.2.178:32021|lh|DWw7V9u0| CurlFtp ftp; ftp.setFtpIPAndPort("192.1.2.178", 32021); ftp.setFtpUsernameAndPassword("lh", "DWw7V9u0"); std::string ftpPath = "lh"; std::vector vecFile; std::vector vecDir; ftp.getFileList(ftpPath, vecFile); ftp.getDirList(ftpPath, vecDir); for(auto& file : vecFile) { SPDLOG_LOGGER_INFO(m_logger, "{}", file); } for(auto& dir : vecDir) { SPDLOG_LOGGER_INFO(m_logger, "{}", dir); } if(ftp.isDirExist(ftpPath)) { SPDLOG_LOGGER_INFO(m_logger, "文件夹存在"); } else { SPDLOG_LOGGER_INFO(m_logger, "文件夹不存在"); } } SPAServer::~SPAServer() { }