generated from Sithas/conan_template
Переименование GUID на UUID
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ class IUserDAO
|
||||
public:
|
||||
virtual std::string Create(const User& created_user) = 0;
|
||||
|
||||
virtual std::optional<User> GetByGUID(std::string guid) = 0;
|
||||
virtual std::optional<User> GetByUUID(std::string uuid) = 0;
|
||||
|
||||
virtual std::optional<User> GetByLogin(std::string login) = 0;
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ string MySQLUserDAO::Create(const User& created_user)
|
||||
return ""s;
|
||||
}
|
||||
|
||||
optional<User> MySQLUserDAO::GetByGUID(string guid)
|
||||
optional<User> MySQLUserDAO::GetByUUID(string uuid)
|
||||
{
|
||||
mysqlx::SqlResult sql_result = session_.sql("SELECT * FROM `up_and_down`.`users` WHERE (guid = '" + guid + "') LIMIT 1;"s).execute();
|
||||
mysqlx::SqlResult sql_result = session_.sql("SELECT * FROM `up_and_down`.`users` WHERE (uuid = '" + uuid + "') LIMIT 1;"s).execute();
|
||||
|
||||
return GetSingleUserBySQLResult(std::move(sql_result));
|
||||
}
|
||||
@@ -58,13 +58,13 @@ std::optional<User> MySQLUserDAO::GetSingleUserBySQLResult(mysqlx::SqlResult&& s
|
||||
|
||||
auto row_data = *rows.begin();
|
||||
|
||||
string user_guid = row_data[0].get<string>();
|
||||
string user_uuid = row_data[0].get<string>();
|
||||
string user_login = row_data[1].get<string>();
|
||||
string user_hashed_password = row_data[2].get<string>();
|
||||
|
||||
User user;
|
||||
|
||||
user.SetGUID(user_guid);
|
||||
user.SetUUID(user_uuid);
|
||||
user.SetLogin(user_login);
|
||||
user.SetHashedPassword(user_hashed_password);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public:
|
||||
|
||||
std::string Create(const User& created_user) override;
|
||||
|
||||
std::optional<User> GetByGUID(std::string guid) override;
|
||||
std::optional<User> GetByUUID(std::string uuid) override;
|
||||
|
||||
std::optional<User> GetByLogin(std::string login) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user