hlp:荆州版本

This commit is contained in:
kite_lucs
2026-10-19 17:03:47 +08:00
parent e533ea8e0b
commit 065b146998
438 changed files with 163143 additions and 185387 deletions
+80 -80
View File
@@ -1,80 +1,80 @@
#ifndef __DBREDIS_H
#define __DBREDIS_H
#include <QtSql>
class DBRedis
{
public:
DBRedis();
~DBRedis();
/***
* @描述 : 设定值
* @入参 : key 键
value 值
expiry 单位为秒 默认为 0
0 为永不过期
其他值必须大于0
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int setData(const QString&key, const QString&value, uint32_t expiry = 0);
/***
* @描述 : 获取值
* @入参 : key 键
* @输出 : value 值
* @返回 : 0 成功
1 数据库错误
2 不存在该数据或已过期
3 数据库错误
*/
static int getData(const QString&key, QString&value);
/***
* @描述 : 删除值
* @入参 : key 键
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int deleteData(const QString&key);
private:
static QSqlDatabase m_DataBase;
static QString m_ConnectName;
static bool m_HasInit;
private:
/***
* @描述 : 初始化
* @入参 : 无
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int init();
/***
* @描述 : 删除过期的条目
* @入参 : 无
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int deleteExpiredEntries();
};
#endif // !__DBREDIS_H
#ifndef __DBREDIS_H
#define __DBREDIS_H
#include <QtSql>
class DBRedis
{
public:
DBRedis();
~DBRedis();
/***
* @描述 : 设定值
* @入参 : key 键
value 值
expiry 单位为秒 默认为 0
0 为永不过期
其他值必须大于0
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int setData(const QString&key, const QString&value, uint32_t expiry = 0);
/***
* @描述 : 获取值
* @入参 : key 键
* @输出 : value 值
* @返回 : 0 成功
1 数据库错误
2 不存在该数据或已过期
3 数据库错误
*/
static int getData(const QString&key, QString&value);
/***
* @描述 : 删除值
* @入参 : key 键
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int deleteData(const QString&key);
private:
static QSqlDatabase m_DataBase;
static QString m_ConnectName;
static bool m_HasInit;
private:
/***
* @描述 : 初始化
* @入参 : 无
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int init();
/***
* @描述 : 删除过期的条目
* @入参 : 无
* @输出 : 无
* @返回 : 0 成功
1 数据库错误
3 数据库错误
*/
static int deleteExpiredEntries();
};
#endif // !__DBREDIS_H