[Server] Serve card-art rules and params through the database interface (#7850)

The four card-art commands still prepared their statements inline through
Servatrice_DatabaseInterface: the two card_art_params updates in
cmdSetCardArtParams, the rule upsert and delete, and the rule listing that
mapped rows to protocol entries. Add CardArtRuleRecord, upsertCardArtRule,
removeCardArtRule, getCardArtRules, setCardArtParams and clearCardArtParams to
Server_DatabaseInterface with fail-closed defaults, implement them with the
previous statements, and keep the validation, clamping, in-memory userInfo sync
and broadcast in the handler.
This commit is contained in:
BruebachL 2026-11-10 12:16:30 +01:00 • committed by GitHub
parent 2608228bdd
commit 1822d16a72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 140 additions and 38 deletions

View file

@ -875,6 +875,38 @@ public:
{
return false;
}
/** @brief One card-art name rule. */
struct CardArtRuleRecord
{
QString cardName;
QString cardProviderId;
QString mode;
QString reason;
};
virtual bool upsertCardArtRule(const QString & /* cardName */,
const QString & /* cardProviderId */,
const QString & /* mode */,
const QString & /* reason */,
int /* createdBy */)
{
return false;
}
virtual bool removeCardArtRule(const QString & /* cardName */, const QString & /* cardProviderId */)
{
return false;
}
virtual bool getCardArtRules(QList<CardArtRuleRecord> & /* rules */)
{
return false;
}
virtual bool setCardArtParams(int /* userId */, const QString & /* paramsJson */)
{
return false;
}
virtual bool clearCardArtParams(int /* userId */)
{
return false;
}
/**
* @brief Whether the given card art may be shown (card art rules).
*