mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Move deck folder writes into the database interface (#7833)
Setting a deck or folder public, creating a folder, and deleting a folder tree were SQL statements in the socket handler. Declare them on Server_DatabaseInterface with a DeckStorageResult so the caller can still tell a missing row from a failed write, implement them in Servatrice_DatabaseInterface with the same statements, and let the three folder commands ask the injected interface. Readiness probing keeps its previous ignore-the-result shape.
This commit is contained in:
parent
8c0e796b0d
commit
23781af1f0
5 changed files with 121 additions and 59 deletions
|
|
@ -195,6 +195,29 @@ public:
|
|||
{
|
||||
return false;
|
||||
}
|
||||
/** @brief Outcome of a deck-storage write, so callers can map it to a response code. */
|
||||
enum class DeckStorageResult
|
||||
{
|
||||
Ok,
|
||||
NotFound,
|
||||
Failed
|
||||
};
|
||||
virtual DeckStorageResult setDeckVisibility(int /* deckId */, int /* userId */, bool /* isPublic */)
|
||||
{
|
||||
return DeckStorageResult::Failed;
|
||||
}
|
||||
virtual DeckStorageResult setDeckFolderVisibility(int /* folderId */, int /* userId */, bool /* isPublic */)
|
||||
{
|
||||
return DeckStorageResult::Failed;
|
||||
}
|
||||
virtual DeckStorageResult createDeckFolder(int /* parentId */, int /* userId */, const QString & /* name */)
|
||||
{
|
||||
return DeckStorageResult::Failed;
|
||||
}
|
||||
/** @brief Delete a folder, its deck files, and every nested folder. */
|
||||
virtual void deleteDeckFolder(int /* folderId */)
|
||||
{
|
||||
}
|
||||
virtual bool removeForgotPassword(const QString & /* user */)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue