mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-01 17:24:57 +00:00
code: cpp,dbal,client (2 files)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define DBAL_CLIENT_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include "types.hpp"
|
||||
@@ -39,6 +40,9 @@ public:
|
||||
|
||||
Result<std::vector<User>> searchUsers(const std::string& query, int limit = 20);
|
||||
Result<int> countUsers(const std::optional<UserRole>& role = std::nullopt);
|
||||
Result<int> updateManyUsers(const std::map<std::string, std::string>& filter,
|
||||
const UpdateUserInput& updates);
|
||||
Result<int> deleteManyUsers(const std::map<std::string, std::string>& filter);
|
||||
|
||||
Result<bool> setCredential(const CreateCredentialInput& input);
|
||||
Result<bool> verifyCredential(const std::string& username, const std::string& password);
|
||||
|
||||
@@ -58,6 +58,15 @@ Result<int> Client::countUsers(const std::optional<UserRole>& role) {
|
||||
return entities::user::count(getStore(), role);
|
||||
}
|
||||
|
||||
Result<int> Client::updateManyUsers(const std::map<std::string, std::string>& filter,
|
||||
const UpdateUserInput& updates) {
|
||||
return entities::user::updateMany(getStore(), filter, updates);
|
||||
}
|
||||
|
||||
Result<int> Client::deleteManyUsers(const std::map<std::string, std::string>& filter) {
|
||||
return entities::user::deleteMany(getStore(), filter);
|
||||
}
|
||||
|
||||
Result<bool> Client::setCredential(const CreateCredentialInput& input) {
|
||||
return entities::credential::set(getStore(), input);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user