$guid, "detectionMessage" => $detectionMessage, ); send_common_to_x7($messageDetectUrl, $bizParams, $appkey, $prikey, $pubkey, $apiMethod, "messageDetectRespone", "client", $osType); exit; function messageDetectRespone($response, $appkey, $prikey, $pubkey) { // bizResp字段 类型 必选 说明 // respCode String 是 响应码,SUCCESS代表成功 // respMsg String 是 响应提示信息 // detectResult Array 否 道具信息数组 // // detectResult 字段 类型 必选 说明 // detectionLogId String 是 检查结果的ID // level String 是 检查结果的分类级别【1:通过,-1:不通过】 // labelCode String 是 违规分类码【0:正常; 1:其他; 2:色情; 3:广告; 4:暴恐; 5:违禁; 6:涉政; 7:谩骂; 8:灌水; 9:违反广告法; 10:涉价值观】 // sensitiveWords Array 是 敏感词数组 global $messageDetectUrl, $operateType; \Logging\LogInfo("response:" . print_r($response, true)); $bizResp = $response["bizResp"]; echo $bizResp; $ret = json_decode($bizResp, true); // 不通过时,汇报处理结果 if ($ret["respCode"] == "SUCCESS" && array_key_exists("detectResult", $ret) && $ret["detectResult"]["level"] == -1) { // 请求bizParams // bizParams 字段 类型 必选 说明 // detectionLogId String 是 检查结果的ID // operateType String 是 对检测结果的处理类型【1:拦截发送(禁止该消息发送并提示发送文本中含有敏感信息); 2:不展示(允许发送但实际上会拦截不展示); 3、屏蔽关键词(屏蔽敏感词后剩余内容允许发送); 4、其他】 // // 响应bizResp // bizResp 字段 类型 必选 说明 // respCode String 是 响应码,SUCCESS代表成功 // respMsg String 是 响应提示信息 $detectionLogId = $ret["detectResult"]["detectionLogId"]; $apiMethod = "x7Detection.messageDetectReport"; $bizParams = array( "detectionLogId" => $detectionLogId, "operateType" => $operateType, ); send_common_to_x7($messageDetectUrl, $bizParams, $appkey, $prikey, $pubkey, $apiMethod); } } function DefaultFail($respMsg) { echo json_encode(array("respCode" => "FAIL", "respMsg" => $respMsg)); }