|  | @@ -1183,4 +1183,335 @@ SATHTTP_API int DownloadScript(std::string url, std::string strCaseId, std::stri
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	return FALSE;
 | 
	
		
			
				|  |  | -}
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +SATHTTP_API int StopTaskFromRunner(std::string url, std::string strInstnaceId, SATParameters::STStopTaskResp &stStopTaskResp)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	// 转化为Json;
 | 
	
		
			
				|  |  | +	cJSON *pRoot = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pRoot == NULL )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		return -1;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	ASSERT(cJSON_AddStringToObject(pRoot, "sysCode", ""));
 | 
	
		
			
				|  |  | +	ASSERT(cJSON_AddStringToObject(pRoot, "function", ""));
 | 
	
		
			
				|  |  | +	cJSON *pData = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pData )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "instanceId", strInstnaceId.c_str()));
 | 
	
		
			
				|  |  | +		// 添加到根结点中;
 | 
	
		
			
				|  |  | +		cJSON_AddItemToObject(pRoot, "data", pData);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	char *pText = cJSON_Print(pRoot);
 | 
	
		
			
				|  |  | +	std::string post_data = "requestMsg=";
 | 
	
		
			
				|  |  | +	post_data.append(CharEncoding::EnCode_UTF8URL(pText));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	// 释放堆内存;
 | 
	
		
			
				|  |  | +	if (pText)
 | 
	
		
			
				|  |  | +		delete pText;
 | 
	
		
			
				|  |  | +	pText = NULL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if ( pRoot )
 | 
	
		
			
				|  |  | +		cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +	pRoot = NULL;		
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	CCurlClient curl;
 | 
	
		
			
				|  |  | +	std::string reponse;	
 | 
	
		
			
				|  |  | +	CURLcode curlCode = CURLE_OK;
 | 
	
		
			
				|  |  | +	if ( CURLE_OK == curl.Initialize() )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		if (_tcsstr(url.c_str(), "https://") || _tcsstr(url.c_str(), "HTTPS://") )
 | 
	
		
			
				|  |  | +			curlCode = curl.Posts(url, post_data, reponse);
 | 
	
		
			
				|  |  | +		else
 | 
	
		
			
				|  |  | +			curlCode = curl.Post(url, post_data, reponse);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if ( curlCode == CURLE_OK )
 | 
	
		
			
				|  |  | +		{
 | 
	
		
			
				|  |  | +			reponse = CharEncoding::DeCode_URLUTF8(reponse.c_str());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			// 解析返回值;
 | 
	
		
			
				|  |  | +			pRoot = cJSON_Parse(reponse.c_str());
 | 
	
		
			
				|  |  | +			if (pRoot != NULL)
 | 
	
		
			
				|  |  | +			{
 | 
	
		
			
				|  |  | +				cJSON *pMsg = cJSON_GetObjectItem(pRoot, "responseMsg");
 | 
	
		
			
				|  |  | +				if ( pMsg )
 | 
	
		
			
				|  |  | +				{
 | 
	
		
			
				|  |  | +					stStopTaskResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
 | 
	
		
			
				|  |  | +					stStopTaskResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
 | 
	
		
			
				|  |  | +					stStopTaskResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					stStopTaskResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					if ( stStopTaskResp.strCode == "00" )
 | 
	
		
			
				|  |  | +					{				
 | 
	
		
			
				|  |  | +						// 释放内存;
 | 
	
		
			
				|  |  | +						cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +						// 返回结果;
 | 
	
		
			
				|  |  | +						return TRUE;
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				// 错误产生,可输出msg方便查询;
 | 
	
		
			
				|  |  | +				cJSON_Delete(pRoot);	
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return FALSE;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +SATHTTP_API int SaveCaseOrTaskLog(std::string url, const SATParameters::STSaveLogReq &stSaveLogReq, SATParameters::STSaveLogResp &stSaveLogResp)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	// 转化为Json;
 | 
	
		
			
				|  |  | +	cJSON *pRoot = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pRoot == NULL )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		return -1;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	ASSERT(cJSON_AddStringToObject(pRoot, "useId", stSaveLogReq.strUserId.c_str()));
 | 
	
		
			
				|  |  | +	cJSON *pData = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pData )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "fileType", stSaveLogReq.strFileType.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseId", stSaveLogReq.strCaseId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "taskId", stSaveLogReq.strTaskId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "executeId", stSaveLogReq.strExecuteId.c_str()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		// 添加到根结点中;
 | 
	
		
			
				|  |  | +		cJSON_AddItemToObject(pRoot, "data", pData);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	char *pText = cJSON_Print(pRoot);
 | 
	
		
			
				|  |  | +	std::string post_data = CharEncoding::EnCode_UTF8URL(pText);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	// 释放堆内存;
 | 
	
		
			
				|  |  | +	if (pText)
 | 
	
		
			
				|  |  | +		delete pText;
 | 
	
		
			
				|  |  | +	pText = NULL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if ( pRoot )
 | 
	
		
			
				|  |  | +		cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +	pRoot = NULL;		
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	CCurlClient curl;
 | 
	
		
			
				|  |  | +	std::string reponse;	
 | 
	
		
			
				|  |  | +	CURLcode curlCode = CURLE_OK;
 | 
	
		
			
				|  |  | +	if ( CURLE_OK == curl.Initialize() )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		if (_tcsstr(url.c_str(), "https://") || _tcsstr(url.c_str(), "HTTPS://") )
 | 
	
		
			
				|  |  | +			curlCode = curl.Posts(url, post_data, reponse);
 | 
	
		
			
				|  |  | +		else
 | 
	
		
			
				|  |  | +			curlCode = curl.PostFile(url, post_data, stSaveLogReq.strUploads, reponse);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if ( curlCode == CURLE_OK )
 | 
	
		
			
				|  |  | +		{
 | 
	
		
			
				|  |  | +			reponse = CharEncoding::DeCode_URLUTF8(reponse.c_str());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			// 解析返回值;
 | 
	
		
			
				|  |  | +			pRoot = cJSON_Parse(reponse.c_str());
 | 
	
		
			
				|  |  | +			if (pRoot != NULL)
 | 
	
		
			
				|  |  | +			{
 | 
	
		
			
				|  |  | +				cJSON *pMsg = cJSON_GetObjectItem(pRoot, "responseMsg");
 | 
	
		
			
				|  |  | +				if ( pMsg )
 | 
	
		
			
				|  |  | +				{
 | 
	
		
			
				|  |  | +					stSaveLogResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
 | 
	
		
			
				|  |  | +					stSaveLogResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
 | 
	
		
			
				|  |  | +					stSaveLogResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					stSaveLogResp.strData = cJSON_GetObjectItem(pMsg, "data") ? (cJSON_GetObjectItem(pMsg, "data")->valuestring ? cJSON_GetObjectItem(pMsg, "data")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					if ( stSaveLogResp.strCode == "00" )
 | 
	
		
			
				|  |  | +					{				
 | 
	
		
			
				|  |  | +						// 释放内存;
 | 
	
		
			
				|  |  | +						cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +						// 返回结果;
 | 
	
		
			
				|  |  | +						return TRUE;
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				// 错误产生,可输出msg方便查询;
 | 
	
		
			
				|  |  | +				cJSON_Delete(pRoot);	
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return FALSE;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +SATHTTP_API int SaveResultFile(std::string url, const SATParameters::STSaveFileReq &stSaveFileReq, SATParameters::STSaveFileResp &stSaveFileResp) 
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	// 转化为Json;
 | 
	
		
			
				|  |  | +	cJSON *pRoot = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pRoot == NULL )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		return -1;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	ASSERT(cJSON_AddStringToObject(pRoot, "sysCode", ""));
 | 
	
		
			
				|  |  | +	ASSERT(cJSON_AddStringToObject(pRoot, "function", ""));
 | 
	
		
			
				|  |  | +	cJSON *pData = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pData )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "roundNum", stSaveFileReq.strRoundNum.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseRepeat", stSaveFileReq.strCaseRepeat.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "jobRepeat", stSaveFileReq.strJobRepeat.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "instanceId", stSaveFileReq.strInstanceId.c_str()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "deviceId", stSaveFileReq.strDeviceId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "executeId", stSaveFileReq.strExecuteId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "taskName", stSaveFileReq.strTaskName.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "sceneIndex", stSaveFileReq.strSceneIndex.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "taskId", stSaveFileReq.strTaskId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseId", stSaveFileReq.strCaseId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "deviceName", stSaveFileReq.strDeviceName.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "runnerName", stSaveFileReq.strRunnerName.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "runnerIP", stSaveFileReq.strRunnerIP.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "runnerMac", stSaveFileReq.strRunnerMAC.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseName", stSaveFileReq.strCaseName.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseIndex", stSaveFileReq.strCaseIndex.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "taskRepeat", stSaveFileReq.strTaskRepeat.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "busCode", stSaveFileReq.strBusCode.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "fileType", stSaveFileReq.strFileType.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseStep", stSaveFileReq.strCaseStep.c_str()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		// 添加到根结点中;
 | 
	
		
			
				|  |  | +		cJSON_AddItemToObject(pRoot, "data", pData);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	char *pText = cJSON_Print(pRoot);
 | 
	
		
			
				|  |  | +	std::string post_data = CharEncoding::EnCode_UTF8URL(pText);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	// 释放堆内存;
 | 
	
		
			
				|  |  | +	if (pText)
 | 
	
		
			
				|  |  | +		delete pText;
 | 
	
		
			
				|  |  | +	pText = NULL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if ( pRoot )
 | 
	
		
			
				|  |  | +		cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +	pRoot = NULL;		
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	CCurlClient curl;
 | 
	
		
			
				|  |  | +	std::string reponse;	
 | 
	
		
			
				|  |  | +	CURLcode curlCode = CURLE_OK;
 | 
	
		
			
				|  |  | +	if ( CURLE_OK == curl.Initialize() )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		if (_tcsstr(url.c_str(), "https://") || _tcsstr(url.c_str(), "HTTPS://") )
 | 
	
		
			
				|  |  | +			curlCode = curl.Posts(url, post_data, reponse);
 | 
	
		
			
				|  |  | +		else
 | 
	
		
			
				|  |  | +			curlCode = curl.PostFile(url, post_data, stSaveFileReq.strUploads, reponse);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if ( curlCode == CURLE_OK )
 | 
	
		
			
				|  |  | +		{
 | 
	
		
			
				|  |  | +			reponse = CharEncoding::DeCode_URLUTF8(reponse.c_str());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			// 解析返回值;
 | 
	
		
			
				|  |  | +			pRoot = cJSON_Parse(reponse.c_str());
 | 
	
		
			
				|  |  | +			if (pRoot != NULL)
 | 
	
		
			
				|  |  | +			{
 | 
	
		
			
				|  |  | +				cJSON *pMsg = cJSON_GetObjectItem(pRoot, "responseMsg");
 | 
	
		
			
				|  |  | +				if ( pMsg )
 | 
	
		
			
				|  |  | +				{
 | 
	
		
			
				|  |  | +					stSaveFileResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
 | 
	
		
			
				|  |  | +					stSaveFileResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
 | 
	
		
			
				|  |  | +					stSaveFileResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					stSaveFileResp.strData = cJSON_GetObjectItem(pMsg, "data") ? (cJSON_GetObjectItem(pMsg, "data")->valuestring ? cJSON_GetObjectItem(pMsg, "data")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					if ( stSaveFileResp.strCode == "00" )
 | 
	
		
			
				|  |  | +					{				
 | 
	
		
			
				|  |  | +						// 释放内存;
 | 
	
		
			
				|  |  | +						cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +						// 返回结果;
 | 
	
		
			
				|  |  | +						return TRUE;
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				// 错误产生,可输出msg方便查询;
 | 
	
		
			
				|  |  | +				cJSON_Delete(pRoot);	
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return FALSE;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +SATHTTP_API int SaveResultImg(std::string url, const SATParameters::STSaveImgReq &stSaveImgReq, SATParameters::STSaveImgResp &stSaveImgResp)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	// 转化为Json;
 | 
	
		
			
				|  |  | +	cJSON *pRoot = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pRoot == NULL )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		return -1;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	ASSERT(cJSON_AddStringToObject(pRoot, "sysCode", ""));
 | 
	
		
			
				|  |  | +	ASSERT(cJSON_AddStringToObject(pRoot, "function", ""));
 | 
	
		
			
				|  |  | +	cJSON *pData = cJSON_CreateObject();
 | 
	
		
			
				|  |  | +	if ( pData )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "instanceId", stSaveImgReq.strInstanceId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "deviceId", stSaveImgReq.strDeviceId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "roundNum", stSaveImgReq.strRoundNum.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseId", stSaveImgReq.strCaseId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "step", stSaveImgReq.strCaseStep.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "type", stSaveImgReq.strTaskType.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "executeId", stSaveImgReq.strExecuteId.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "caseRepeat", stSaveImgReq.strCaseRepeat.c_str()));
 | 
	
		
			
				|  |  | +		ASSERT(cJSON_AddStringToObject(pData, "jobRepeat", stSaveImgReq.strJobRepeat.c_str()));
 | 
	
		
			
				|  |  | +		// 添加到根结点中;
 | 
	
		
			
				|  |  | +		cJSON_AddItemToObject(pRoot, "data", pData);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	char *pText = cJSON_Print(pRoot);
 | 
	
		
			
				|  |  | +	std::string post_data = CharEncoding::EnCode_UTF8URL(pText);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	// 释放堆内存;
 | 
	
		
			
				|  |  | +	if (pText)
 | 
	
		
			
				|  |  | +		delete pText;
 | 
	
		
			
				|  |  | +	pText = NULL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if ( pRoot )
 | 
	
		
			
				|  |  | +		cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +	pRoot = NULL;		
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	CCurlClient curl;
 | 
	
		
			
				|  |  | +	std::string reponse;	
 | 
	
		
			
				|  |  | +	CURLcode curlCode = CURLE_OK;
 | 
	
		
			
				|  |  | +	if ( CURLE_OK == curl.Initialize() )
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		if (_tcsstr(url.c_str(), "https://") || _tcsstr(url.c_str(), "HTTPS://") )
 | 
	
		
			
				|  |  | +			curlCode = curl.Posts(url, post_data, reponse);
 | 
	
		
			
				|  |  | +		else
 | 
	
		
			
				|  |  | +			curlCode = curl.PostFile(url, post_data, stSaveImgReq.strUploads, reponse);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if ( curlCode == CURLE_OK )
 | 
	
		
			
				|  |  | +		{
 | 
	
		
			
				|  |  | +			reponse = CharEncoding::DeCode_URLUTF8(reponse.c_str());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			// 解析返回值;
 | 
	
		
			
				|  |  | +			pRoot = cJSON_Parse(reponse.c_str());
 | 
	
		
			
				|  |  | +			if (pRoot != NULL)
 | 
	
		
			
				|  |  | +			{
 | 
	
		
			
				|  |  | +				cJSON *pMsg = cJSON_GetObjectItem(pRoot, "responseMsg");
 | 
	
		
			
				|  |  | +				if ( pMsg )
 | 
	
		
			
				|  |  | +				{
 | 
	
		
			
				|  |  | +					stSaveImgResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
 | 
	
		
			
				|  |  | +					stSaveImgResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
 | 
	
		
			
				|  |  | +					stSaveImgResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					stSaveImgResp.strData = cJSON_GetObjectItem(pMsg, "data") ? (cJSON_GetObjectItem(pMsg, "data")->valuestring ? cJSON_GetObjectItem(pMsg, "data")->valuestring : "") : "";
 | 
	
		
			
				|  |  | +					if ( stSaveImgResp.strCode == "00" )
 | 
	
		
			
				|  |  | +					{				
 | 
	
		
			
				|  |  | +						// 释放内存;
 | 
	
		
			
				|  |  | +						cJSON_Delete(pRoot);
 | 
	
		
			
				|  |  | +						// 返回结果;
 | 
	
		
			
				|  |  | +						return TRUE;
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				// 错误产生,可输出msg方便查询;
 | 
	
		
			
				|  |  | +				cJSON_Delete(pRoot);	
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return FALSE;
 | 
	
		
			
				|  |  | +}
 |