Skip to content

Commit 4128f4a

Browse files
committed
modify:merge translation configure
1 parent c2a7dac commit 4128f4a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ typedef struct
5656
XCHAR tszWeatherUrl[MAX_PATH]; //天气接口
5757
XCHAR tszBankUrl[MAX_PATH]; //银行卡验证地址
5858
XCHAR tszOilUrl[MAX_PATH]; //油价接口
59-
XCHAR tszTranslationUrl[MAX_PATH]; //翻译接口
59+
//翻译接口
6060
struct
6161
{
62+
XCHAR tszAPPUrl[MAX_PATH];
6263
XCHAR tszAPPID[MAX_PATH];
6364
XCHAR tszAPPKey[MAX_PATH];
6465
}st_TranslationInfo;

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
124124
_tcsxcpy(pSt_ServerConfig->st_XLog.tszAPIFile, st_JsonXLog["tszAPIFile"].asCString());
125125
_tcsxcpy(pSt_ServerConfig->st_XLog.tszServiceFile, st_JsonXLog["tszServiceFile"].asCString());
126126

127-
if (st_JsonRoot["XApi"].empty() || (5 != st_JsonRoot["XApi"].size()))
127+
if (st_JsonRoot["XApi"].empty() || (4 != st_JsonRoot["XApi"].size()))
128128
{
129129
Config_IsErrorOccur = true;
130130
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XAPI;
@@ -135,8 +135,9 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
135135
_tcsxcpy(pSt_ServerConfig->st_XApi.tszWeatherUrl, st_JsonXApi["tszWeatherUrl"].asCString());
136136
_tcsxcpy(pSt_ServerConfig->st_XApi.tszBankUrl, st_JsonXApi["tszBankUrl"].asCString());
137137
_tcsxcpy(pSt_ServerConfig->st_XApi.tszOilUrl, st_JsonXApi["tszOilUrl"].asCString());
138-
_tcsxcpy(pSt_ServerConfig->st_XApi.tszTranslationUrl, st_JsonXApi["tszTranslationUrl"].asCString());
138+
139139
Json::Value st_JsonTranslationInfo = st_JsonXApi["st_TranslationInfo"];
140+
_tcsxcpy(pSt_ServerConfig->st_XApi.st_TranslationInfo.tszAPPUrl, st_JsonTranslationInfo["url"].asCString());
140141
_tcsxcpy(pSt_ServerConfig->st_XApi.st_TranslationInfo.tszAPPID, st_JsonTranslationInfo["appid"].asCString());
141142
_tcsxcpy(pSt_ServerConfig->st_XApi.st_TranslationInfo.tszAPPKey, st_JsonTranslationInfo["key"].asCString());
142143

XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer,
5050
ModuleHelp_Translation_Convert((ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE)_ttxoi(lpszSrcStr), tszLanguageSrc);
5151
ModuleHelp_Translation_Convert((ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE)_ttxoi(lpszDstStr), tszLanauageDst);
5252

53-
_xstprintf(tszURLStr, _X("%s?appid=%s&q=%s&from=%s&to=%s&salt=%d&sign=%s"), st_ServiceConfig.st_XApi.tszTranslationUrl, st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPID, tszUTFBuffer, tszLanguageSrc, tszLanauageDst, nRandomNumber, tszMD5Str);
53+
_xstprintf(tszURLStr, _X("%s?appid=%s&q=%s&from=%s&to=%s&salt=%d&sign=%s"), st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPUrl, st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPID, tszUTFBuffer, tszLanguageSrc, tszLanauageDst, nRandomNumber, tszMD5Str);
5454
APIClient_Http_Request(_X("GET"), tszURLStr, NULL, NULL, &ptszBodyBuffer, &nBLen);
5555

5656
//解析数据

0 commit comments

Comments
 (0)