Example #1
0
 public function invoke($arrInput)
 {
     try {
         $strUrlHost = $arrInput["urlHostForCurlProxy"];
         $strAppName = $arrInput["appNameForCurlProxy"];
         $strActionInfo = $arrInput["actionInfoForCurlProxy"];
         $strCallType = $arrInput["callTypeForCurlProxy"];
         $arrParamType = json_decode($arrInput["paramTypeForCurlProxy"]);
         $arrUrlParam = array();
         //解析出待发起请求的所有参数
         foreach ($arrParamType as $strParamName => $strType) {
             $arrUrlParam[$strParamName]["type"] = $strType;
             if ("file" !== $strType) {
                 $arrUrlParam[$strParamName]["value"] = $_POST[$strParamName];
             } else {
                 $arrUrlParam[$strParamName]["value"] = "";
             }
         }
         /*foreach ($_POST as $strKey => $strVal) {
         		if($strKey !== 'urlHostForCurlProxy' &&
         			$strKey !== 'appNameForCurlProxy' &&
         			$strKey !== 'actionInfoForCurlProxy' &&
         			$strKey !== 'callTypeForCurlProxy' &&
         			$strKey !== 'paramTypeForCurlProxy' &&
         			$strKey !== 'signCodeForCreateSign') {
             		$arrUrlParam[$strKey] = $strVal;
         		}
             }
             foreach ($_FILES as $strKey => $arrItem) {
             	$arrUrlParam[$strKey] = '@upload_file';
             }*/
         //没有对应的用户,直接退出
         if (strlen(CURRENT_USER) <= 0) {
             Bd_Log::warning("username is null");
             return Navilib_Utils::result(Navilib_CommonError::USER_NOT_LOGIN, array());
         }
         $objDataService = new Service_Data_Testman();
         $arrRet = $objDataService->addRecode(CURRENT_USER, $strUrlHost, $strAppName, $strActionInfo, $strCallType, $arrUrlParam);
         return Navilib_Utils::result($arrRet["errno"], array());
     } catch (Exception $e) {
         Bd_Log::warning($e->getMessage(), $e->getCode());
         return Navilib_Utils::result($e->getCode(), array());
     }
 }