2025-05-19 09:54:33 +08:00
|
|
|
|
#include "database/DaoEntity.h"
|
|
|
|
|
|
|
2025-07-18 09:08:09 +08:00
|
|
|
|
#include "app/errcode.h"
|
|
|
|
|
|
|
2025-08-22 19:06:50 +08:00
|
|
|
|
class DAO1
|
2025-05-19 09:54:33 +08:00
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
static std::shared_ptr<DaoEntity> get(std::string tableName="");
|
|
|
|
|
|
|
2025-08-31 14:38:53 +08:00
|
|
|
|
static Errcode login(std::shared_ptr<DaoEntity> dao, std::string account, std::string passwd, Fields& res);
|
2025-05-19 09:54:33 +08:00
|
|
|
|
|
|
|
|
|
|
static bool writeSystemLog(std::shared_ptr<DaoEntity> dao, int type, std::string userId, std::string account, std::string text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// =======================================================================
|
|
|
|
|
|
// 用户管理数据操作
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询用户
|
|
|
|
|
|
*/
|
2025-08-22 19:06:50 +08:00
|
|
|
|
static bool queryUser(std::vector<Fields>& res);
|
2025-05-19 09:54:33 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 新增用户
|
|
|
|
|
|
*/
|
2025-08-22 19:06:50 +08:00
|
|
|
|
static int insertUser(Fields& fields);
|
2025-05-19 09:54:33 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 修改用户信息
|
|
|
|
|
|
*/
|
2025-08-22 19:06:50 +08:00
|
|
|
|
static int updateUserById(std::string id, Fields& fields);
|
2025-05-19 09:54:33 +08:00
|
|
|
|
};
|