generated from Sithas/conan_template
Рабочая сборка с третьей ручкой
This commit is contained in:
@@ -25,9 +25,7 @@ string MySQLUserDAO::Create(const user& created_user)
|
||||
"INSERT INTO `up_and_down`.`users` (`uuid`, `login`, `hashed_password`) VALUES ('"
|
||||
+ uuid_str + "', '" + created_user.login +"', '" + created_user.hashed_password + "');"s;
|
||||
|
||||
session_.sql(sql_script)
|
||||
.bind(uuid_str, created_user.login, created_user.hashed_password)
|
||||
.execute();
|
||||
session_.sql(sql_script).execute();
|
||||
|
||||
return uuid_str;
|
||||
}
|
||||
@@ -89,10 +87,7 @@ pair<bool, vector<user>> MySQLUserDAO::GetAll(size_t limit, size_t offset)
|
||||
const string user_uuid = row[0].get<string>();
|
||||
const string user_login = row[1].get<string>();
|
||||
|
||||
user.login = user_login;
|
||||
user.uuid = user_uuid;
|
||||
|
||||
ret.second.push_back(std::move(user));
|
||||
ret.second.push_back({.uuid = user_uuid, .login = user_login});
|
||||
--limit;
|
||||
}
|
||||
|
||||
@@ -133,12 +128,10 @@ std::optional<user> MySQLUserDAO::GetSingleUserBySQLResult(mysqlx::SqlResult&& s
|
||||
const string user_login = row_data[1].get<string>();
|
||||
const string user_hashed_password = row_data[2].get<string>();
|
||||
|
||||
user single_user;
|
||||
|
||||
single_user.uuid = user_uuid;
|
||||
single_user.login = user_login;
|
||||
single_user.hashed_password = user_hashed_password;
|
||||
|
||||
return optional<user>(std::move(single_user));
|
||||
return optional<user>({
|
||||
.uuid = user_uuid,
|
||||
.login = user_login,
|
||||
.hashed_password = user_hashed_password
|
||||
});
|
||||
}
|
||||
} // uad
|
||||
|
||||
Reference in New Issue
Block a user