From 116970f499b5003852a9655a215456dfc2747b87 Mon Sep 17 00:00:00 2001
From: w1146869587 <wah1146869587@126.com>
Date: 星期一, 08 十一月 2021 11:21:11 +0800
Subject: [PATCH] mbwatch.txt
---
mbwatch/mbfileutil.h | 20 ++++++
mbwatch/mbfileutil.cpp | 23 +++++++
mbwatch/mbwatch.pro | 8 ++
bak/mbwatch.txt | 7 ++
mbwatch/mbwatchmain.h | 18 ++++++
mbwatch/mbwatchapp.cpp | 15 +++-
mbwatch/mbwatchmain.cpp | 45 +++++++++++++++
mbwatch/mbwatchapp.h | 3 +
8 files changed, 132 insertions(+), 7 deletions(-)
diff --git a/bak/mbwatch.txt b/bak/mbwatch.txt
new file mode 100644
index 0000000..cc26283
--- /dev/null
+++ b/bak/mbwatch.txt
@@ -0,0 +1,7 @@
+CREATE TABLE TN_WATCH_USER (
+ CN_S_LOGIN VARCHAR( 128 ) NOT NULL,
+ CN_S_SERVER_ID VARCHAR( 128 ) NOT NULL,
+ CN_S_BACKUP_DIR VARCHAR( 512 ) NOT NULL,
+ CN_S_SERVER_PATH VARCHAR( 512 ) NOT NULL,
+ primary key(CN_S_LOGIN,CN_S_SERVER_ID)
+);
diff --git a/mbwatch/mbfileutil.cpp b/mbwatch/mbfileutil.cpp
new file mode 100644
index 0000000..767db8c
--- /dev/null
+++ b/mbwatch/mbfileutil.cpp
@@ -0,0 +1,23 @@
+#include "mbfileutil.h"
+#include <QFileInfo>
+#include <QDateTime>
+
+CMBFileUtil::CMBFileUtil()
+{
+
+}
+
+CMBFileUtil::~CMBFileUtil()
+{
+
+}
+
+QString CMBFileUtil::lastModifiedTime(QString fileName)
+{
+ QFileInfo fileInfo(fileName);
+ QDateTime lastModifiedTime;
+ lastModifiedTime = fileInfo.lastModified();
+
+ QString strLastTime = lastModifiedTime.toString("yyyy.MM.dd hh:mm:ss");
+ return strLastTime;
+}
diff --git a/mbwatch/mbfileutil.h b/mbwatch/mbfileutil.h
new file mode 100644
index 0000000..ded730c
--- /dev/null
+++ b/mbwatch/mbfileutil.h
@@ -0,0 +1,20 @@
+#ifndef MBFILEUTIL_H
+#define MBFILEUTIL_H
+#include <QObject>
+
+
+/**************************************************
+*
+* 鏂囦欢宸ュ叿锛堣幏鍙栨枃浠舵渶鍚庝慨鏀规椂闂达紝so on锛�+*
+***************************************************/
+class CMBFileUtil
+{
+public:
+ CMBFileUtil();
+ ~CMBFileUtil();
+public:
+ static QString lastModifiedTime(QString fileName);
+};
+
+#endif // MBFILEUTIL_H
diff --git a/mbwatch/mbwatch.pro b/mbwatch/mbwatch.pro
index 530366e..752f008 100644
--- a/mbwatch/mbwatch.pro
+++ b/mbwatch/mbwatch.pro
@@ -13,7 +13,9 @@
SOURCES += \
main.cpp \
- mbwatchapp.cpp
+ mbfileutil.cpp \
+ mbwatchapp.cpp \
+ mbwatchmain.cpp
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
@@ -25,5 +27,7 @@
include(qtservice/qtservice.pri)
HEADERS += \
- mbwatchapp.h
+ mbfileutil.h \
+ mbwatchapp.h \
+ mbwatchmain.h
diff --git a/mbwatch/mbwatchapp.cpp b/mbwatch/mbwatchapp.cpp
index 74dcba4..cc1d7e8 100644
--- a/mbwatch/mbwatchapp.cpp
+++ b/mbwatch/mbwatchapp.cpp
@@ -1,5 +1,6 @@
#include "mbwatchapp.h"
-
+#include "mbfileutil.h"
+#include <QDebug>
CMBWatchApp::CMBWatchApp(int argc, char **argv)
: QtService<QCoreApplication>(argc, argv, "mbWatchDaemon")
@@ -14,22 +15,26 @@
}
+// 寮�
void CMBWatchApp::start()
{
-
+ m_watchMain.start();
}
+// 鍋滄
void CMBWatchApp::stop()
{
-
+ m_watchMain.stop();
}
+// 鏆傚仠
void CMBWatchApp::pause()
{
-
+ m_watchMain.pause();
}
+// 鎭㈠
void CMBWatchApp::resume()
{
-
+ m_watchMain.resume();
}
diff --git a/mbwatch/mbwatchapp.h b/mbwatch/mbwatchapp.h
index 7f30739..292d9f0 100644
--- a/mbwatch/mbwatchapp.h
+++ b/mbwatch/mbwatchapp.h
@@ -2,6 +2,7 @@
#define MBWATCHAPP_H
#include <QCoreApplication>
#include "qtservice.h"
+#include "mbwatchmain.h"
class CMBWatchApp : public QtService<QCoreApplication>
{
@@ -13,6 +14,8 @@
virtual void stop();
virtual void pause();
virtual void resume();
+private:
+ CMBWatchMain m_watchMain;
};
#endif // MBWATCHAPP_H
diff --git a/mbwatch/mbwatchmain.cpp b/mbwatch/mbwatchmain.cpp
new file mode 100644
index 0000000..65163e9
--- /dev/null
+++ b/mbwatch/mbwatchmain.cpp
@@ -0,0 +1,45 @@
+#include "mbwatchmain.h"
+// mb_watch_user.db
+// TN_WATCH_USER
+// CN_S_LOGIN 鑱斿悎涓婚敭
+// CN_S_SERVER_ID 鑱斿悎涓婚敭
+// CN_S_BACKUP_DIR
+// CN_S_SERVER_PATH
+
+// mb_watch_log_xxxx.db( xxx---> serverid login )
+// CN_S_ID 鍞竴鍊硷紝鐢�CN_S_FILE_NAME ---> md5鍖栨垚
+// CN_S_FILE_NAME
+// CN_T_LAST_MODFIY
+
+// mb_watch.db
+// TN_ND_BACKUPDIR_FILE
+
+CMBWatchMain::CMBWatchMain()
+{
+
+}
+
+CMBWatchMain::~CMBWatchMain()
+{
+
+}
+
+void CMBWatchMain::start()
+{
+
+}
+
+void CMBWatchMain::stop()
+{
+
+}
+
+void CMBWatchMain::pause()
+{
+
+}
+
+void CMBWatchMain::resume()
+{
+
+}
diff --git a/mbwatch/mbwatchmain.h b/mbwatch/mbwatchmain.h
new file mode 100644
index 0000000..7df86d6
--- /dev/null
+++ b/mbwatch/mbwatchmain.h
@@ -0,0 +1,18 @@
+#ifndef MBWATCHMAIN_H
+#define MBWATCHMAIN_H
+#include <QObject>
+
+class CMBWatchMain : public QObject
+{
+ Q_OBJECT
+public:
+ CMBWatchMain();
+ ~CMBWatchMain();
+public:
+ void start();
+ void stop();
+ void pause();
+ void resume();
+};
+
+#endif // MBWATCHMAIN_H
--
Gitblit v1.9.1