code: cpp,dbal,client (2 files)

This commit is contained in:
2025-12-26 06:04:38 +00:00
parent e6c1e353d5
commit 920dc0cd6c
2 changed files with 26 additions and 0 deletions

View File

@@ -36,6 +36,12 @@ public:
Result<int> batchUpdateUsers(const std::vector<UpdateUserBatchItem>& updates);
Result<int> batchDeleteUsers(const std::vector<std::string>& ids);
Result<bool> setCredential(const CreateCredentialInput& input);
Result<bool> verifyCredential(const std::string& username, const std::string& password);
Result<bool> setCredentialFirstLoginFlag(const std::string& username, bool first_login);
Result<bool> getCredentialFirstLoginFlag(const std::string& username);
Result<bool> deleteCredential(const std::string& username);
Result<PageView> createPage(const CreatePageInput& input);
Result<PageView> getPage(const std::string& id);
Result<PageView> getPageBySlug(const std::string& slug);

View File

@@ -50,6 +50,26 @@ Result<int> Client::batchDeleteUsers(const std::vector<std::string>& ids) {
return entities::user::batchDelete(getStore(), ids);
}
Result<bool> Client::setCredential(const CreateCredentialInput& input) {
return entities::credential::set(getStore(), input);
}
Result<bool> Client::verifyCredential(const std::string& username, const std::string& password) {
return entities::credential::verify(getStore(), username, password);
}
Result<bool> Client::setCredentialFirstLoginFlag(const std::string& username, bool flag) {
return entities::credential::setFirstLogin(getStore(), username, flag);
}
Result<bool> Client::getCredentialFirstLoginFlag(const std::string& username) {
return entities::credential::getFirstLogin(getStore(), username);
}
Result<bool> Client::deleteCredential(const std::string& username) {
return entities::credential::remove(getStore(), username);
}
Result<PageView> Client::createPage(const CreatePageInput& input) {
return entities::page::create(getStore(), input);
}