#include "database/DaoEntity.h"

#include "app/errcode.h"

class DAO1
{
public:
    static std::shared_ptr<DaoEntity> get(std::string tableName="");

    static Errcode login(std::shared_ptr<DaoEntity> dao, std::string account, std::string passwd, Fields& res);

    static bool writeSystemLog(std::shared_ptr<DaoEntity> dao, int type, std::string userId, std::string account, std::string text);

    
    // =======================================================================
    //  用户管理数据操作

    /**
    * 查询用户
    */
    static bool queryUser(std::vector<Fields>& res);

    /**
    * 新增用户
    */
    static int insertUser(Fields& fields);

    /**
    * 修改用户信息
    */
    static int updateUserById(std::string id, Fields& fields);
};