实现策略配置功能

This commit is contained in:
lixiaoyuan
2025-08-28 18:42:37 +08:00
parent 8f6c83147b
commit dda905cda0
47 changed files with 1311 additions and 863 deletions

View File

@@ -3,7 +3,7 @@
//#include "Spdlogger.h"
#include "Logger.h"
MysqlClient::MysqlClient(MysqlOption option) : option_(option)
MysqlClient::MysqlClient(MysqlOption option) : option(option)
{
conn();
}
@@ -20,7 +20,7 @@ int MysqlClient::conn()
return 0;
}
mysql_ = mysql_init(nullptr);
MYSQL* ret = mysql_real_connect(mysql_, option_.host.c_str(), option_.user.c_str(), option_.password.c_str(), option_.dbname.c_str(), option_.port, NULL, 0);
MYSQL* ret = mysql_real_connect(mysql_, option.host.c_str(), option.user.c_str(), option.password.c_str(), option.dbname.c_str(), option.port, NULL, 0);
if (ret == NULL)
{
std::string err = mysql_error(mysql_);