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;
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ using namespace std;
|
||||
|
||||
namespace uad
|
||||
{
|
||||
const string& User::GetGUID() const noexcept
|
||||
const string& User::GetUUID() const noexcept
|
||||
{
|
||||
return guid_;
|
||||
return uuid_;
|
||||
}
|
||||
|
||||
void User::SetGUID(const string& new_guid)
|
||||
void User::SetUUID(const string& new_uuid)
|
||||
{
|
||||
guid_ = new_guid;
|
||||
uuid_ = new_uuid;
|
||||
}
|
||||
|
||||
const string& User::GetLogin() const noexcept
|
||||
|
||||
+3
-3
@@ -8,13 +8,13 @@ namespace uad
|
||||
{
|
||||
class User
|
||||
{
|
||||
std::string guid_;
|
||||
std::string uuid_;
|
||||
std::string login_;
|
||||
std::string hashed_password_;
|
||||
public:
|
||||
[[nodiscard]] const std::string& GetGUID() const noexcept;
|
||||
[[nodiscard]] const std::string& GetUUID() const noexcept;
|
||||
|
||||
void SetGUID(const std::string& new_guid);
|
||||
void SetUUID(const std::string& new_uuid);
|
||||
|
||||
[[nodiscard]] const std::string& GetLogin() const noexcept;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user