//
// Created by zxm on 2022/12/13.
//

#ifndef UOS_RECOVERY_ROLLBACK_NOTIFY_H
#define UOS_RECOVERY_ROLLBACK_NOTIFY_H
#include <QString>
#include <QObject>

struct RollbackInfo {
    int status = -1; // 0: success;  1: failed
    QString curVersion;
    QString curVersionDisplay;
    QString rollbackVersion;
    QString rollbackVersionDisplay;
};

class RollbackNotify : public QObject {
    Q_OBJECT
public:
    RollbackNotify();
    ~RollbackNotify();

    bool notify();

private:
    bool clearRollbackAutoNotify();
    RollbackInfo getRollbackInfo(const QString &recoveryConf);
    bool sendNotify(const RollbackInfo &rollbackInfo);
};

#endif
