#ifndef CHATDATABASE_H
#define CHATDATABASE_H

#include <memory>
#include <QDateTime>
#include <QVariantList>

class ChatDatabase
{
public:
    ChatDatabase();
    ~ChatDatabase();

    bool insertOne(QString sessionID, int index, QString message);
    bool updateOperateTime(QString sessionID, int index);
    bool deleteBySessionID(QString sessionID);
    bool updateFeedback(QString sessionID, int index, QString message);

    QStringList selectBySessionID(QString sessionID);
    QStringList selectAll();
    QStringList selectAllDialogue();
    int selectMaxHistoryId();
    void updateMaxHistoryId(int history_id);
    static ChatDatabase* getChatDatabase();
private:
    void initBase();
    void createTable();

private:
    class Private;
    std::shared_ptr<Private> d;
};

#endif // CHATDATABASE_H
