|
@@ -5,6 +5,7 @@
|
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
|
+#include "CurlFtp.h"
|
|
|
|
|
|
|
|
|
SPAServer::SPAServer()
|
|
@@ -16,15 +17,44 @@ SPAServer::SPAServer()
|
|
|
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();
|
|
|
+ // 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<std::string> vecFile;
|
|
|
+ std::vector<std::string> 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()
|