From 2287ce83e3576e320c59469b0e09db0a84f84599 Mon Sep 17 00:00:00 2001 From: jhc <2991879965@qq.com> Date: 星期一, 04 十一月 2024 12:21:14 +0800 Subject: [PATCH] Merge branch 'master' of ssh://115.28.86.8:29418/~admin/昆仑_1025 --- Server/马渝杭/code/versionmanage.cpp | 251 +++++++++++++ Client/刘子航/log/日志_刘子航_1104.doc | 0 Client/李宵增/log/历史查询_李宵增_1102.doc | 0 Server/马渝杭/code/type.h.autosave | 69 +++ Client/刘子航/document/昆仑_警报管理.docx | 0 Client/宋昊昳/log/日志_宋昊昳_1104.doc | 0 Server/马渝杭/log/日志_马渝杭_20241104.doc | 0 Server/马渝杭/code/server_version.pro | 29 + Server/马渝杭/code/common.h | 277 ++++++++------ Server/马渝杭/code/versionmanage.ui | 24 + Server/马渝杭/log/20241104昆仑日报.doc | 0 Server/马渝杭/code/versionmanage_main.cpp | 9 Client/宋昊昳/log/日志_宋昊昳_1101.doc | 0 Server/马渝杭/code/server_version.pro.user | 318 +++++++++++++++++ Server/马渝杭/code/versionmanage.h | 60 +++ 15 files changed, 915 insertions(+), 122 deletions(-) diff --git "a/Client/\345\210\230\345\255\220\350\210\252/document/\346\230\206\344\273\221_\350\255\246\346\212\245\347\256\241\347\220\206.docx" "b/Client/\345\210\230\345\255\220\350\210\252/document/\346\230\206\344\273\221_\350\255\246\346\212\245\347\256\241\347\220\206.docx" index a8e3721..d18bcbb 100644 --- "a/Client/\345\210\230\345\255\220\350\210\252/document/\346\230\206\344\273\221_\350\255\246\346\212\245\347\256\241\347\220\206.docx" +++ "b/Client/\345\210\230\345\255\220\350\210\252/document/\346\230\206\344\273\221_\350\255\246\346\212\245\347\256\241\347\220\206.docx" Binary files differ diff --git "a/Client/\345\210\230\345\255\220\350\210\252/log/\346\227\245\345\277\227_\345\210\230\345\255\220\350\210\252_1104.doc" "b/Client/\345\210\230\345\255\220\350\210\252/log/\346\227\245\345\277\227_\345\210\230\345\255\220\350\210\252_1104.doc" new file mode 100644 index 0000000..de344e6 --- /dev/null +++ "b/Client/\345\210\230\345\255\220\350\210\252/log/\346\227\245\345\277\227_\345\210\230\345\255\220\350\210\252_1104.doc" Binary files differ diff --git "a/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1101.doc" "b/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1101.doc" index b906225..8353c3b 100644 --- "a/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1101.doc" +++ "b/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1101.doc" Binary files differ diff --git "a/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1104.doc" "b/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1104.doc" new file mode 100644 index 0000000..0698228 --- /dev/null +++ "b/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1104.doc" Binary files differ diff --git "a/Client/\346\235\216\345\256\265\345\242\236/log/\345\216\206\345\217\262\346\237\245\350\257\242_\346\235\216\345\256\265\345\242\236_1102.doc" "b/Client/\346\235\216\345\256\265\345\242\236/log/\345\216\206\345\217\262\346\237\245\350\257\242_\346\235\216\345\256\265\345\242\236_1102.doc" new file mode 100644 index 0000000..096b020 --- /dev/null +++ "b/Client/\346\235\216\345\256\265\345\242\236/log/\345\216\206\345\217\262\346\237\245\350\257\242_\346\235\216\345\256\265\345\242\236_1102.doc" Binary files differ diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/common.h" "b/Server/\351\251\254\346\270\235\346\235\255/code/common.h" index b6c770d..0b1523a 100644 --- "a/Server/\351\251\254\346\270\235\346\235\255/code/common.h" +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/common.h" @@ -1,162 +1,195 @@ #ifndef COMMON_H #define COMMON_H -#include <string.h> -//绉佹湁鍗忚灏佽 -//璇锋眰鍝嶅簲缁撴瀯浣撴湁鏁版嵁澶�+鏁版嵁浣� - -//浣跨敤鏋氫妇鏉ョ粺涓�鍚勭鍔熻兘绫诲瀷銆� +#include <string.h> enum TypeInfo{ - LOGIN_REQ, //鐧诲綍璇锋眰 - LOGIN_RES, - VERSIONUPDATA_REQ, // 鐗堟湰鏇存柊璇锋眰 - VERSIONUPDATA_RES, - VERSIONNUM_REQ, //鐗堟湰鍙疯姹� - VERSIONNUM_RES, - UPLOAD_FILE_REQ, - UPLOAD_FILE_RES, - VERSIONINFOENTRY_REQ, //鐗堟湰淇℃伅鏉$洰 - VERSIONINFOENTRY_RES + + //鑷姩鍗囩骇 + VERSION_NUM_REQ, // 鐗堟湰鍙疯姹� + VERSION_NUM_RES, // 鐗堟湰鍙峰搷搴� + UPLOAD_FILE_REQ, // 涓婁紶鏂囦欢鐨勮姹� + UPLOAD_FILE_RES, // 涓婁紶鏂囦欢鐨勫搷搴� + VERSION_INFOENTRY_REQ, // 鐗堟湰淇℃伅褰曞叆璇锋眰 + VERSION_INFOENTRY_RES, //鐗堟湰淇℃伅褰曞叆鍝嶅簲 + VERSION_UPDATE_REQ, // 鐗堟湰鏇存柊璇锋眰 + VERSION_UPDATE_RES, // 鐗堟湰鏇存柊鍝嶅簲 + FILE_DOWNLOADS_REQ, // 鐗堟湰鏇存柊鏂囦欢涓嬭浇璇锋眰 + FILE_DOWNLOADS_RES, // 鐗堟湰鏇存柊鏂囦欢涓嬭浇鍝嶅簲 + DOWNLOAD_SUCCESSFULLY_RES, // 鏇存柊鏂囦欢涓嬭浇鎴愬姛鐨勫搷搴� + + }; -struct Head -{ - int type; // 鍔熻兘绫诲瀷锛岃В鍐虫瘡涓寘鐨勫叿浣撲綔鐢紝鍖哄垎涓氬姟 - int len; //灏佸寘闀垮害 - -}; -// 鐧诲綍涓氬姟 -// 鐧诲綍璇锋眰 -struct LoginReq -{ - Head head; - - char user_name[32]; - char password[32]; - LoginReq(){ - head.type=LOGIN_REQ; - head.len=sizeof(LoginReq); - } -}; -//鐧诲綍鏉冮檺缁撴瀯浣� -struct PermissionInfo -{ - int admin; //绠$悊鍛� - int history; //鍘嗗彶鏌ョ湅 - int version_manager;//鐗堟湰绠$悊 - int log_search; //鏃ュ織鏌ョ湅 - int flaw_mark ; //缂洪櫡鏍囪 - +struct Head{ + int type; + int len; }; -//鐧诲綍鍝嶅簲 -struct LoginRes +//鑷姩鍗囩骇 +struct VersionNumReq // 鐗堟湰鍙疯姹� { Head head; - char user_name[32]; - int state; // 鐧诲綍鐘舵�� - PermissionInfo per; - LoginRes(){ - head.type=LOGIN_RES; - head.len=sizeof(LoginRes); + VersionNumReq() { + head.type = VERSION_NUM_REQ; + head.len = sizeof(VersionNumReq); } }; -struct VersionUpdataReq //鐗堟湰鏇存柊璇锋眰鐨勭粨鏋勪綋 + +struct VersionNumRes // 鐗堟湰鍙峰搷搴� { Head head; - VersionUpdataReq(){ - head.type=VERSIONUPDATA_REQ; - head.len=sizeof(VersionUpdataReq); + char versionId[64]; // 鐗堟湰鍙� + VersionNumRes() { + head.type = VERSION_NUM_RES; + head.len = sizeof(VersionNumRes); } }; -struct VersionUpdataRes //鐗堟湰鏇存柊鍝嶅簲鐨勭粨鏋勪綋 -{ - Head head; - char version_id[64]; // 鐗堟湰鍙� - char update_date[32]; //鏇存柊鏃堕棿 - char file_path[128]; //鏈嶅姟绔彁渚涙渶鏂扮増鏈殑鏈湴璺緞 - VersionUpdataRes(){ - head.type=VERSIONUPDATA_REQ; - head.len=sizeof(VersionUpdataReq); - } -}; -struct VersionNumReq //鐗堟湰鍙疯姹� -{ - Head head; - VersionNumReq(){ - head.type=VERSIONNUM_REQ; - head.len=sizeof(VersionNumReq); - } -}; -struct VersionNumRes -{ - Head head; - char version_id[64]; - VersionNumRes(){ - head.type=VERSIONNUM_RES; - head.len=sizeof(VersionNumRes); - } -}; -//鏂囦欢浼犺緭鍔熻兘 + +// 鏂囦欢浼犺緭 struct FileInfo { - char file_name[256]; - long long file_size; - char s_filepath[32]; - char content[0]; //鏌旀�ф暟缁勭粨鏋勪綋 + char fileName[256]; + long long fileSize; + char s_filepath[128]; + char content[0]; }; -struct UploadFileReq + +struct UploadFileReq // 涓婁紶鏂囦欢鐨勮姹� { Head head; FileInfo fileInfo; - UploadFileReq(){ - head.type=UPLOAD_FILE_REQ; - head.len=sizeof(UploadFileReq); + UploadFileReq() { + head.type = UPLOAD_FILE_REQ; + head.len = sizeof(UploadFileReq); } }; -struct UploadFileRes -{ - Head head; - int status; - long long file_size; //鎬诲ぇ灏� - long long file_cuesize; //鏂囦欢宸蹭紶澶у皬 - UploadFileRes(){ - head.type=UPLOAD_FILE_RES; - head.len=sizeof(UploadFileRes); - } -}; -//鐗堟湰淇℃伅褰曞叆---鐗堟湰淇℃伅鏉$洰 -struct VersionInfoEntryReq -{ - Head head; - char version_id[64]; - char version_id_old[64]; - char s_filepath[32]; //鏈嶅姟鍣ㄦ斁鏈�鏂扮増鏈殑璺緞 - char version_description[256]; //鏇存柊鎻忚堪 - char version_creattime[32]; //鏇存柊鏃堕棿 - char filename[16][128]; //鏀寔澶氭枃浠朵笂浼� - long long filesize[16]; //鏂囦欢缁勭殑澶у皬 - char c_filepath[16][128]; //瀹㈡埛绔殑瀹夎璺緞 - int filenum; //涓�娆$増鏈洿鏂版墍闇�鏂囦欢涓暟 - VersionInfoEntryReq(){ - head.type=VERSIONINFOENTRY_REQ; - head.len=sizeof(VersionInfoEntryReq); +struct UploadFileRes { // 涓婁紶鏂囦欢鐨勫搷搴� + Head head; + bool state = false; + char fileName[256]; + long long file_size; + UploadFileRes() + { + head.type = UPLOAD_FILE_RES; + head.len = sizeof(UploadFileRes); } }; -//鍝嶅簲 + +// 鐗堟湰淇℃伅褰曞叆 +// 璇锋眰 +//struct VersionInfoEntryReq { +// Head head; +// char version_id[64]; // 鐗堟湰鍙� +// char version_id_old[64]; // 涓婁竴涓増鏈彿 +// char s_filepath[32]; //鏈嶅姟鍣ㄦ斁鏈�鏂扮増鏈殑璺緞 +// char version_description[256]; //鏇存柊鍐呭 +// char version_creattime[32]; // 鏇存柊鏃堕棿 +// char filename[16][128]; +// long long filesize[16]; +// char c_filepath[16][128]; +// int fileNum; + +// VersionInfoEntryReq() +// { +// head.type = VERSIONINFOENTRY_REQ; +// head.len = sizeof(VersionInfoEntryReq); +// } +//}; + +struct VersionInfoEntryReq { + Head head; + char versionId[64]; // 鐗堟湰鍙� + char versionIdOld[64]; // 涓婁竴涓増鏈彿 + int fileNum; + char context[0]; //鍖呭惈涓嬭浇鏂囦欢淇℃伅 + + VersionInfoEntryReq() + { + head.type = VERSION_INFOENTRY_REQ; + head.len = sizeof(VersionInfoEntryReq); + } +}; + +// 鐗堟湰淇℃伅褰曞叆鍝嶅簲 struct VersionInfoEntryRes { Head head; - char version_id_old[64]; // 鐗堟湰鍙� + bool state = false; VersionInfoEntryRes() { - head.type = VERSIONINFOENTRY_RES; + head.type = VERSION_INFOENTRY_RES; head.len = sizeof(VersionInfoEntryRes); } }; +// 鐗堟湰鏇存柊璇锋眰 +struct VersionUpdateReq { + Head head; + char curVersionId[64]; // 鐗堟湰鍙� + VersionUpdateReq() + { + head.type = VERSION_UPDATE_REQ; + head.len = sizeof(VersionUpdateReq); + } +}; + +// 鐗堟湰鏇存柊鍝嶅簲 +struct VersionUpdateRes { + Head head; + bool state = false; + char versionId[64]; // 鐗堟湰鍙� + char updateDate[32]; // 鏇存柊鏃堕棿 + char versionDescription[1024]; //鏇存柊鎻忚堪 + + VersionUpdateRes() + { + head.type = VERSION_UPDATE_RES; + head.len = sizeof(VersionUpdateRes); + } +}; + +// 鐗堟湰鏇存柊鏂囦欢涓嬭浇璇锋眰 +struct FileDownloadsReq { + Head head; + char versionId[64]; // 鐗堟湰鍙� + FileDownloadsReq() + { + head.type = FILE_DOWNLOADS_REQ; + head.len = sizeof(FileDownloadsReq); + } +}; + +// 鐗堟湰鏇存柊鏂囦欢涓嬭浇鍝嶅簲 +struct FileDownloadsRes { + Head head; + char versionId[64]; // 鐗堟湰鍙� + char filename[128]; //鏂囦欢鍚� + long long filesize; //鏂囦欢澶у皬 + char c_filepath[128]; //瀹㈡埛绔斁鏈�鏂扮増鏈殑鏈湴璺緞 + int fileNum; // 鏂囦欢鏁伴噺 + long long allFileSize; // 鏂囦欢鎬诲ぇ灏� + char content[0]; + FileDownloadsRes() + { + head.type = FILE_DOWNLOADS_RES; + head.len = sizeof(FileDownloadsRes); + } +}; + +// 鏇存柊鏂囦欢涓嬭浇鎴愬姛鐨勫搷搴� +struct DownloadSuccessfullyRes { + Head head; + bool state = false; + char fileName[256]; + long long fileSize; + DownloadSuccessfullyRes() + { + head.type = DOWNLOAD_SUCCESSFULLY_RES; + head.len = sizeof(DownloadSuccessfullyRes); + } +}; diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/server_version.pro" "b/Server/\351\251\254\346\270\235\346\235\255/code/server_version.pro" new file mode 100644 index 0000000..9c996af --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/server_version.pro" @@ -0,0 +1,29 @@ + + +QT += core gui +QT += network + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++17 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +HEADERS += \ + versionmanage.h \ + common.h \ + +SOURCES += \ + versionmanage_main.cpp \ + versionmanage.cpp \ + +FORMS += \ + versionmanage.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +DISTFILES += diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/server_version.pro.user" "b/Server/\351\251\254\346\270\235\346\235\255/code/server_version.pro.user" new file mode 100644 index 0000000..e262b77 --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/server_version.pro.user" @@ -0,0 +1,318 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE QtCreatorProject> +<!-- Written by QtCreator 4.5.0, 2024-11-02T23:00:40. --> +<qtcreator> + <data> + <variable>EnvironmentId</variable> + <value type="QByteArray">{7612f2ce-8739-48f9-bb70-81cdc706b9e5}</value> + </data> + <data> + <variable>ProjectExplorer.Project.ActiveTarget</variable> + <value type="int">0</value> + </data> + <data> + <variable>ProjectExplorer.Project.EditorSettings</variable> + <valuemap type="QVariantMap"> + <value type="bool" key="EditorConfiguration.AutoIndent">true</value> + <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> + <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> + <value type="QString" key="language">Cpp</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">CppGlobal</value> + </valuemap> + </valuemap> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> + <value type="QString" key="language">QmlJS</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> + </valuemap> + </valuemap> + <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> + <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> + <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> + <value type="int" key="EditorConfiguration.IndentSize">4</value> + <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> + <value type="int" key="EditorConfiguration.MarginColumn">80</value> + <value type="bool" key="EditorConfiguration.MouseHiding">true</value> + <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> + <value type="int" key="EditorConfiguration.PaddingMode">1</value> + <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> + <value type="bool" key="EditorConfiguration.ShowMargin">false</value> + <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> + <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value> + <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> + <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> + <value type="int" key="EditorConfiguration.TabSize">8</value> + <value type="bool" key="EditorConfiguration.UseGlobal">true</value> + <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> + <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> + <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> + <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> + <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.PluginSettings</variable> + <valuemap type="QVariantMap"/> + </data> + <data> + <variable>ProjectExplorer.Project.Target.0</variable> + <valuemap type="QVariantMap"> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.9.4 MinGW 32bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.9.4 MinGW 32bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.594.win32_mingw53_kit</value> + <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QtProject/build-server_version-Desktop_Qt_5_9_4_MinGW_32bit-Debug</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QtProject/build-server_version-Desktop_Qt_5_9_4_MinGW_32bit-Release</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QtProject/build-server_version-Desktop_Qt_5_9_4_MinGW_32bit-Profile</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">閮ㄧ讲</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鍦ㄦ湰鍦伴儴缃�</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> + <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value> + <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> + <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> + <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> + <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> + <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> + <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> + <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> + <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> + <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> + <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> + <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> + <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> + <value type="int">0</value> + <value type="int">1</value> + <value type="int">2</value> + <value type="int">3</value> + <value type="int">4</value> + <value type="int">5</value> + <value type="int">6</value> + <value type="int">7</value> + <value type="int">8</value> + <value type="int">9</value> + <value type="int">10</value> + <value type="int">11</value> + <value type="int">12</value> + <value type="int">13</value> + <value type="int">14</value> + </valuelist> + <value type="int" key="PE.EnvironmentAspect.Base">2</value> + <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">server_version</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/QtProject/server_version/server_version.pro</value> + <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">server_version.pro</value> + <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">D:/QtProject/build-server_version-Desktop_Qt_5_9_4_MinGW_32bit-Debug</value> + <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> + <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> + <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> + <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.TargetCount</variable> + <value type="int">1</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.FileVersion</variable> + <value type="int">18</value> + </data> + <data> + <variable>Version</variable> + <value type="int">18</value> + </data> +</qtcreator> diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/type.h.autosave" "b/Server/\351\251\254\346\270\235\346\235\255/code/type.h.autosave" new file mode 100644 index 0000000..fe9d89b --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/type.h.autosave" @@ -0,0 +1,69 @@ +#ifndef TYPE_H +#define TYPE_H +#include <string.h> +//绉佹湁鍗忚灏佽 + +//璇锋眰鍝嶅簲缁撴瀯浣撴湁鏁版嵁澶�+鏁版嵁浣� + +//浣跨敤鏋氫妇鏉ョ粺涓�鍚勭鍔熻兘绫诲瀷銆� + +enum TypeInfo{ + LOGIN_REQ, //鐧诲綍璇锋眰 + LOGIN_RES, + VERSIONUPDATA_REQ, // 鐗堟湰鏇存柊璇锋眰 + VERSIONUPDATA_RES, + VEESIONNUM_REQ, //鐗堟湰鍙疯姹� + VERSIONNUM_RES, + UPLOAD_FILE_REQ, + UPLOAD_FILE_RES, + VERSIONINFOENTRY_REQ, //鐗堟湰淇℃伅鏉$洰 + VERSIONINFOENTRY_RES +}; + +struct Head +{ + int type; // 鍔熻兘绫诲瀷锛岃В鍐虫瘡涓寘鐨勫叿浣撲綔鐢紝鍖哄垎涓氬姟 + int len; //灏佸寘闀垮害 + +}; +// 鐧诲綍涓氬姟 +// 鐧诲綍璇锋眰 +struct LoginReq +{ + Head head; + + char user_name[32]; + char password[32]; + LoginReq(){ + head.type=LOGIN_REQ; + head.len=sizeof(LoginReq); + } +}; +//鐧诲綍鏉冮檺缁撴瀯浣� +struct PermissionInfo +{ + int admin; //绠$悊鍛� + int history; //鍘嗗彶鏌ョ湅 + int version_manager;//鐗堟湰绠$悊 + int log_search; //鏃ュ織鏌ョ湅 + int flaw_mark ; //缂洪櫡鏍囪 + +}; + +//鐧诲綍鍝嶅簲 +struct LoginRes +{ + Head head; + char user_name[32]; + int state; // 鐧诲綍鐘舵�� + PermissionInfo per; + LoginRes(){ + head.type= + } +}; + + + + + +#endif // TYPE_H diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.cpp" "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.cpp" new file mode 100644 index 0000000..9c90563 --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.cpp" @@ -0,0 +1,251 @@ +#include "versionmanage.h" +#include "ui_versionmanage.h" +#include<QDateTime> +#include<QThread> + +VersionManage::VersionManage(QWidget *parent) + :QMainWindow(parent) +{ + //Tcp閾炬帴 + m_client=new QTcpSocket(this); + m_client->connectToHost("127.0.0.1",16888); + if(m_client->waitForConnected()){ + qDebug()<<"conn ok!"; + connect(m_client,SIGNAL(readyRead()),this,SLOT(myRead())); + + }else{ + qDebug()<<"conn fail or waiting for conn"; + } + + //鍚戝鎴风鍙戦�佺増鏈彿璇锋眰 + sendVersionNumReq(); + + /*鍒涘缓涓�涓腑澶獥鍙i儴浠� centralWidget锛屽苟灏嗗叾浣滀负褰撳墠绐楀彛鐨勫瓙鎺т欢銆� + 璁剧疆涓�涓瀭鐩村竷灞� layout 鍒� centralWidget 涓婏紝 + 浣垮緱浠讳綍娣诲姞鍒� layout 鐨勫瓙鎺т欢閮戒細鍦� centralWidget 涓粠涓婂埌涓嬫帓鍒椼��*/ + QWidget *centralWidget=new QWidget(this); + QVBoxLayout *layout=new QVBoxLayout(centralWidget); + + //鑾峰彇褰撳墠宸ヤ綔鐩綍 + QString currentPath=QDir::currentPath(); + qDebug()<<"褰撳墠宸ヤ綔璺緞锛�"<<currentPath; + + //鏂囦欢瀵煎叆鎸夐挳鍜屾枃浠跺悕鏍囩鍒涘缓 + QPushButton *importButton=new QPushButton(tr("瀵煎叆鏂囦欢"),this); + connect(importButton,&QPushButton::clicked,this,&VersionManage::importFile); + fileNameLabel=new QLabel(tr("鏈�夋嫨鏂囦欢"),this); + orignalPathLabel=new QLabel(tr("鏈�夋嫨鏂囦欢璺緞"),this); + + //鐗堟湰鍙峰拰璺緞缂栬緫妗嗗垵濮嬪寲 + currVersionEdit=new QLineEdit(this); + clientPathEdit=new QLineEdit(this); + serverPathEdit=new QLineEdit(this); + versionDescriptionEdit = new QTextEdit(this); + //prevVersionEdit=new QLineEdit(this); + + //鑰佺増鏈粍鍚堜笅鎷夋,鍚勭鍗犱綅绗﹁璁� + prevVersionComboBox=new QComboBox(this); + prevVersionComboBox->addItem(tr("涓婁竴涓増鏈彿")); + + //prevVersionEdit->setPlaceholderText(tr("涓婁竴涓増鏈彿")); + currVersionEdit->setPlaceholderText(tr("褰撳墠鐗堟湰鍙�")); + clientPathEdit->setPlaceholderText(tr("瀹㈡埛绔矾鍔�")); + serverPathEdit->setPlaceholderText(tr("鏈嶅姟鍣ㄨ矾寰�")); + versionDescriptionEdit->setPlaceholderText(tr("璇疯緭鍏ユ柊鐗堟湰鎻忚堪")); + + //娣诲姞鐗堟湰鐨勬寜閽�,鍒拌〃鏍� + QPushButton *addButton =new QPushButton(tr("娣诲姞"),this); + connect(addButton,&QPushButton::clicked,this,&VersionManage::addFileInfo); + + //甯冨眬涓婂崐閮ㄥ垎 + layout->addWidget(prevVersionComboBox); + prevVersionComboBox->setStyleSheet("font-size: 22px;"); + layout->addWidget(currVersionEdit); + currVersionEdit->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + layout->addWidget(serverPathEdit); + serverPathEdit->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + layout->addWidget(versionDescriptionEdit); + versionDescriptionEdit->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + //鑷姩濉啓鏈嶅姟绔矾寰� + connect(currVersionEdit,&QLineEdit::textChanged, + this,[this](const QString &text){ + serverPathEdit->setText("./version/"+text); + }); + layout->addWidget(importButton); + importButton->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + layout->addWidget(fileNameLabel); + fileNameLabel->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + layout->addWidget(orignalPathLabel); + orignalPathLabel->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + layout->addWidget(clientPathEdit); + clientPathEdit->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + layout->addWidget(addButton); + addButton->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + + //涓嬪崐閮ㄥ垎琛ㄦ牸鍒涘缓 + fileTable=new QTableWidget(0,7,this); + fileTable->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); + fileTable->setHorizontalHeaderLabels({tr("鏂囦欢鍚�"), tr("鏂囦欢澶у皬"), tr("涓婁竴涓増鏈彿"), tr("褰撳墠鐗堟湰鍙�"), tr("鏂囦欢鍘熷璺緞"), tr("瀹㈡埛绔矾寰�"), tr("鏈嶅姟鍣ㄨ矾寰�")}); + QPushButton *savebutton=new QPushButton(tr("淇濆瓨鑷虫暟鎹簱"),this); + connect(savebutton,&QPushButton::clicked,this,&VersionManage::saveToDisk); + + layout->addWidget(fileTable); + fileTable->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + layout->addWidget(savebutton); + savebutton->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px;"); + + QPushButton* deleteButton=new QPushButton(tr("鍒犻櫎涓�涓枃浠�"),this); + deleteButton->setStyleSheet("font-family: 'Microsoft YaHei'; font-size: 22px"); + connect(deleteButton,&QPushButton::clicked,this,[&](){ + int currrow=fileTable->currentRow(); + if(currrow!=-1){ + fileTable->removeRow(currrow); + } + }); + layout->addWidget(deleteButton); + //绐楀彛 + resize(1500, 800); + setCentralWidget(centralWidget); + + +} + +// 鍙戦�佺増鏈彿璇锋眰 +void VersionManage::sendVersionNumReq() +{ + VersionNumReq req; + int len = m_client->write((char*)&req,req.head.len); + qDebug()<<"len:"<<len; + +} + +//瀵煎叆鏂囦欢鍔熻兘 +void VersionManage::importFile() +{ //鎵撳紑鏂囦欢瀵硅瘽妗� + importedFilePath=QFileDialog::getOpenFileName(this, + tr("閫夋嫨鏂囦欢"),"",tr("鎵�鏈夋枃浠�(*)")); + if(!importedFilePath.isEmpty()){ + QFileInfo fileInfo(importedFilePath); + fileNameLabel->setText(fileInfo.fileName()); //鏄剧ず鏂囦欢鍚�+璺緞 + orignalPathLabel->setText(importedFilePath); + clientPathEdit->setText(importedFilePath); + serverPathEdit->setText(importedFilePath); + + } +} + +void VersionManage::addFileInfo() +{ + if(importedFilePath.isEmpty()){ + return ; + } + int rowCount=fileTable->rowCount(); + fileTable->insertRow(rowCount); + + QFileInfo fileInfo(importedFilePath); + fileTable->setItem(rowCount,0,new QTableWidgetItem(fileInfo.fileName())); + qDebug()<<fileInfo.size(); + fileTable->setItem(rowCount,1,new QTableWidgetItem(QString::number(fileInfo.size()))); + fileTable->setItem(rowCount,2,new QTableWidgetItem(prevVersionComboBox->currentText()));//** + fileTable->setItem(rowCount,3,new QTableWidgetItem(currVersionEdit->text())); + fileTable->setItem(rowCount,4,new QTableWidgetItem(orignalPathLabel->text())); + fileTable->setItem(rowCount,5,new QTableWidgetItem(clientPathEdit->text())); + fileTable->setItem(rowCount,6,new QTableWidgetItem(serverPathEdit->text())); + + //娣诲姞鍒拌〃鏍硷紝娓呯┖鍐呭 + //prevVersionComboBox->clear(); + //currVersionEdit->clear(); + //serverPathEdit->clear(); + clientPathEdit->clear(); + fileNameLabel->clear(); + orignalPathLabel->clear(); + importedFilePath.clear(); +} + +//灏嗚〃鏍间腑鐨勬枃浠跺彟瀛樹负鎸囧畾鍦扮偣 +void VersionManage::saveToDisk() +{ + if(fileTable->rowCount()!=0){ + for(int row=0;row<fileTable->rowCount();++row){ + QString saveDirectory = fileTable->item(row, 6)->text();//鏈嶅姟鍣ㄥ湴鍧� + QString fileName = fileTable->item(row, 0)->text(); + QString sourceFilePath = fileTable->item(row, 4)->text(); //瀹㈡埛鏂囦欢鍘熻矾寰� +// QString destinationFilePath = saveDirectory + "/" + fileName; + + QFile fl(sourceFilePath); //鎵撳紑鏈湴鏂囦欢锛堢増鏈窡淇″彿鐨勬枃浠讹級 + qDebug()<< "鎵撳紑鍓�"; + qDebug()<< sourceFilePath; + if(fl.open(QIODevice::ReadOnly)){ + + //QFile::copy(sourceFilePath,destinationFilePath); + qDebug()<< "鎵撳紑鍓�"; + long long all_size = fl.size() + sizeof(UploadFileReq);//鎬诲ぇ灏忔妸鎺nfo浜� + UploadFileReq *req=(UploadFileReq*) (new char[all_size]); + req->head.type=UPLOAD_FILE_REQ; + req->head.len==all_size; + req->fileInfo.fileSize=fl.size(); + strcpy(req->fileInfo.s_filepath,saveDirectory.toLocal8Bit().data()); + qDebug()<<"s_filepath锛�"<< req->fileInfo.s_filepath; + strcpy(req->fileInfo.fileName,fileName.toLocal8Bit().data()); + memcpy(req->fileInfo.content,fl.readAll().data(),fl.size()); + //缁勫寘瀹屾垚锛屽彂鍖� + qDebug()<<m_client->write((char*)req,req->head.len); + m_client->flush(); //绔嬪嵆鍙戦�� + m_client->waitForBytesWritten(); //鍚屾绛夊緟鏁版嵁鍐欏叆瀹屾垚 + + delete req; + qDebug()<<"鍙戦�佹暟鎹簱鎴愬姛锛�"; + fl.close(); + + //绛夊緟鍥炲簲 + qDebug()<<"waiting for 8 seconds..."; + QThread::sleep(8); + qDebug()<<"Done waiting"; + + //鏁版嵁搴撲俊鎭綍鍏ワ紝鐗堟湰淇℃伅鏉$洰 + VersionInfoEntryReq *req_2=new VersionInfoEntryReq; + strcpy_s(req_2->versionId,currVersionEdit->text().toLocal8Bit().data()); + strcpy_s(req_2->versionIdOld,prevVersionComboBox->currentText().toLocal8Bit().data()); + req_2->fileNum=fileTable->rowCount(); + + QString str=serverPathEdit->text()+versionDescriptionEdit->toPlainText() + +QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"); + for(int i=0;i<fileTable->rowCount();++i){ + str+=fileTable->item(i,0)->text()+fileTable->item(i,1)->text()+fileTable->item(i,5)->text(); + } + strcpy(req_2->context,str.toLocal8Bit().data());//_s 淇濇姢 + qDebug()<<"len:"<<m_client->write((char*)req_2,req_2->head.len); + + fileTable->setRowCount(0); + } + + + } + } +} + +void VersionManage::myRead() +{ + QByteArray buffer=m_client->readAll(); + qDebug()<<"buffer:"<<buffer; + //蹇冭烦妫�鏌� + //瑙e寘 + int type=((Head*)buffer.data())->type; + if(type==VERSION_NUM_RES){ + //鐗堟湰鍙风浉搴� + } + else if(type==UPLOAD_FILE_RES){} +} + + + + + + + + + + + + + diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.h" "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.h" new file mode 100644 index 0000000..9eaf94e --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.h" @@ -0,0 +1,60 @@ +#ifndef VERSIONMANAGE_H +#define VERSIONMANAGE_H + +#include<QMainWindow> +#include<QWidget> +#include<QVBoxLayout> +#include<QPushButton> +#include<QLineEdit> +#include<QTableWidget> +#include<QFileDialog> //閫夋嫨鏂囨湰鎴栫洰褰� +#include<QLabel> +#include<QFile> +#include<QTextStream> //鐢ㄤ簬鏂囨湰鏍煎紡鐨勮鍐欐搷浣�,鍐欏叆鍐呭瓨 +#include<QComboBox> +#include<QTcpSocket> +#include<qstring.h> +#include<qstringlist.h> +#include<QVector> +#include<QTextEdit> +#include "common.h" + +class VersionManage: public QMainWindow +{ + Q_OBJECT + + +public: + VersionManage(QWidget *parent = nullptr); + + void sendVersionNumReq(); + +private slots: + void importFile(); + void addFileInfo(); + void saveToDisk(); //鏂囦欢淇濆瓨鍒版暟鎹簱 + + void myRead(); //鏀跺寘妲� + +private: + QTcpSocket *m_client; + QComboBox *prevVersionComboBox; + QLineEdit *currVersionEdit; + QLineEdit *clientPathEdit; //瀹㈡埛绔矾寰勮緭鍏� + QLineEdit *serverPathEdit; + //QLineEdit *prevVersionEdit; + QLabel *fileNameLabel; //鏄剧ず鏂囦欢 + QLabel *orignalPathLabel; + QTableWidget *fileTable; + QString importedFilePath; //瀛樺偍瀵煎叆鏂囦欢璺緞 + QTextEdit *versionDescriptionEdit; + + /*鍘熷锛�/my_project/src/main.cpp + * 瀹㈡埛绔痺锛欳:\Users\Username\Documents\my_project\src\main.cpp + * 鏈嶅姟绔細/var/git/my_project.git/refs/heads/main +*/ + + +}; + +#endif // VERSIONMANAGE_H diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.ui" "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.ui" new file mode 100644 index 0000000..89920b8 --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage.ui" @@ -0,0 +1,24 @@ +<ui version="4.0"> + <author/> + <comment/> + <exportmacro/> + <class>versionmanage</class> + <widget class="QMainWindow" name="versionmanage"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle"> + <string>MainWindow</string> + </property> + <widget class="QMenuBar" name="menubar"/> + <widget class="QWidget" name="centralwidget"/> + <widget class="QStatusBar" name="statusbar"/> + </widget> + <pixmapfunction/> + <connections/> +</ui> diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage_main.cpp" "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage_main.cpp" new file mode 100644 index 0000000..f76ddf1 --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/versionmanage_main.cpp" @@ -0,0 +1,9 @@ +#include"versionmanage.h" +#include<QApplication> + +int main(int argc,char* argv[]){ + QApplication a(argc,argv); + VersionManage w; + w.show(); + return a.exec(); +} diff --git "a/Server/\351\251\254\346\270\235\346\235\255/log/20241104\346\230\206\344\273\221\346\227\245\346\212\245.doc" "b/Server/\351\251\254\346\270\235\346\235\255/log/20241104\346\230\206\344\273\221\346\227\245\346\212\245.doc" new file mode 100644 index 0000000..c4e8716 --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/log/20241104\346\230\206\344\273\221\346\227\245\346\212\245.doc" Binary files differ diff --git "a/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241104.doc" "b/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241104.doc" new file mode 100644 index 0000000..b7876b4 --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241104.doc" Binary files differ -- Gitblit v1.8.0