Client/¼½ºÆêÆ/log/ÈÕÖ¾_¼½ºÆêÆ_1104.docBinary files differ
Client/Áõ×Óº½/document/À¥ÂØ_¾¯±¨¹ÜÀí.docxBinary files differ
Client/Áõ×Óº½/log/ÈÕÖ¾_Áõ×Óº½_1104.docBinary files differ
Client/ËÎê»i/log/ÈÕÖ¾_ËÎê»i_1101.docBinary files differ
Client/ËÎê»i/log/ÈÕÖ¾_ËÎê»i_1104.docBinary files differ
Client/ÀîÏüÔö/log/ÀúÊ·²éѯ_ÀîÏüÔö_1102.docBinary files differ
Client/ÍõöÎöÎ/log/ÈÕÖ¾_ÍõöÎöÎ_1104.docBinary files differ
Client/Ö£¿ÎÄ/log/Ö£¿ÎÄ1104.docBinary files differ
Client/¹¨ÆôÏé/log/ÈÕ־ģ°å_¹¨ÆôÏé_1104.docBinary files differ
Server/Àîתת/log/ÅäÖùÜÀí_Àîתת_1104.docBinary files differ
Server/ÂíÓ庼/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); } }; Server/ÂíÓ庼/code/server_version.pro
New file @@ -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 += Server/ÂíÓ庼/code/server_version.pro.user
New file @@ -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> Server/ÂíÓ庼/code/type.h.autosave
New file @@ -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 Server/ÂíÓ庼/code/versionmanage.cpp
New file @@ -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(); /*å建ä¸ä¸ªä¸å¤®çªå£é¨ä»¶ 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);//æ»å¤§å°ææ§infoäº 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; //å¿è·³æ£æ¥ //è§£å int type=((Head*)buffer.data())->type; if(type==VERSION_NUM_RES){ //çæ¬å·ç¸åº } else if(type==UPLOAD_FILE_RES){} } Server/ÂíÓ庼/code/versionmanage.h
New file @@ -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 * 客æ·ç«¯wï¼C:\Users\Username\Documents\my_project\src\main.cpp * æå¡ç«¯ï¼/var/git/my_project.git/refs/heads/main */ }; #endif // VERSIONMANAGE_H Server/ÂíÓ庼/code/versionmanage.ui
New file @@ -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> Server/ÂíÓ庼/code/versionmanage_main.cpp
New file @@ -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(); } Server/ÂíÓ庼/log/20241104À¥ÂØÈÕ±¨.docBinary files differ
Server/ÂíÓ庼/log/ÈÕÖ¾_ÂíÓ庼_20241104.docBinary files differ
common.h
@@ -613,10 +613,11 @@ //ç产计å管ç struct PdplanInfo { int id;//ç产计åç¼å· char planName[32];//ç产计ååå int planId;//订åç¼å· char planName[32];//订ååå char startDate[32];//èµ·å§æ¥æ char closingDate[32];//æªè³æ¥æ char closingDate[32];//äº¤ä»æ¥æ char pdName[8];//产åå double plannedPd;//计åç产é double actualPd;//å®é ç产é double progress;//ç产è¿åº¦ @@ -626,7 +627,9 @@ struct MonoutputInfo { int month;//æä»½ double output;//æäº§é double aOutput;//a产åæäº§é double bOutput;//b产åæäº§é double cOutput;//c产åæäº§é }; //æ·»å 䏿¡ç产计åç请æ±ç»æä½ @@ -700,12 +703,14 @@ struct QueryPdplanReq { Head head; int id;//ç产计åç¼å· char planName[32];//ç产计ååå int planId;//订åç¼å· char planName[32];//订åååå char startDate[32];//èµ·å§æ¥æ char closingDate[32];//æªè³æ¥æ char closingDate[32];//äº¤ä»æ¥æ char pdName[8];//产åå double plannedPd;//计åç产é double actualPd;//å®é ç产é double progress;//ç产è¿åº¦ int finishOntime;//æ¯å¦ææå®æ QueryPdplanReq() { head.type = QUERY_PDPLAN_REQ; @@ -798,7 +803,9 @@ { Head head; int month;//æä»½ double output;//æäº§é double aOutput;//a产åæäº§é double bOutput;//b产åæäº§é double cOutput;//c产åæäº§é QueryMonoutputReq() { head.type = QUERY_MONOUTPUT_REQ; head.len = sizeof(QueryMonoutputReq);