Skip to content

Commit f137074

Browse files
committed
modify:save time configure move to db configure
1 parent f1aa6dc commit f137074

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

XEngine_Source/MQCore_ConfigModule/Config_Define.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ typedef struct
3333
int nMQTTThread;
3434
}st_XMax;
3535
struct
36-
{
37-
int nDBMonth;
38-
}st_XTime;
39-
struct
4036
{
4137
XCHAR tszLOGFile[MAX_PATH];
4238
int nMaxSize;
@@ -79,6 +75,10 @@ typedef struct
7975
bool bPubClear;
8076
}st_UserTime;
8177
}st_MQUser;
78+
struct
79+
{
80+
int nDBMonth;
81+
}st_MQData;
8282
}MESSAGEQUEUE_DBCONFIG;
8383
//////////////////////////////////////////////////////////////////////////
8484
// 导出函数定义

XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ bool CConfig_Json::Config_Json_File(LPCXSTR lpszConfigFile,XENGINE_SERVERCONFIG
8686
pSt_ServerConfig->st_XMax.nWSThread = st_JsonXMax["nWSThread"].asInt();
8787
pSt_ServerConfig->st_XMax.nMQTTThread = st_JsonXMax["nMQTTThread"].asInt();
8888

89-
if (st_JsonRoot["XTime"].empty() || (1 != st_JsonRoot["XTime"].size()))
90-
{
91-
Config_IsErrorOccur = true;
92-
Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XTIME;
93-
return false;
94-
}
95-
Json::Value st_JsonXTime = st_JsonRoot["XTime"];
96-
pSt_ServerConfig->st_XTime.nDBMonth = st_JsonXTime["nDBMonth"].asInt();
97-
9889
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
9990
{
10091
Config_IsErrorOccur = true;
@@ -250,16 +241,22 @@ bool CConfig_Json::Config_Json_DBFile(LPCXSTR lpszConfigFile, MESSAGEQUEUE_DBCON
250241
return false;
251242
}
252243
Json::Value st_JsonUser = st_JsonRoot["MQUser"];
253-
254244
if (st_JsonUser["UserTime"].empty())
255245
{
256246
Config_IsErrorOccur = true;
257247
Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XMAX;
258248
return false;
259249
}
260250
Json::Value st_JsonUserTime = st_JsonUser["UserTime"];
261-
262251
pSt_DBConfig->st_MQUser.st_UserTime.bPubClear = st_JsonUserTime["bPubClear"].asBool();
263252

253+
if (st_JsonRoot["MQData"].empty() || (1 != st_JsonRoot["MQData"].size()))
254+
{
255+
Config_IsErrorOccur = true;
256+
Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XTIME;
257+
return false;
258+
}
259+
Json::Value st_JsonMQData = st_JsonRoot["MQData"];
260+
pSt_DBConfig->st_MQData.nDBMonth = st_JsonMQData["nDBMonth"].asInt();
264261
return true;
265262
}

XEngine_Source/MQCore_DBModule/MQCore_DBModule.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<LinkIncremental>true</LinkIncremental>
75-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<IncludePath>$(XEngine_Include);..\MQCore_DBModule;$(IncludePath)</IncludePath>
7676
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
7777
</PropertyGroup>
7878
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

0 commit comments

Comments
 (0)