2019-12-19 15:00:25 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
2020-03-05 12:41:49 +08:00
|
|
|
namespace wchat\wx;
|
2019-12-19 15:00:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class ContentAsyncCheck
|
|
|
|
|
* @package wchat
|
|
|
|
|
*/
|
|
|
|
|
class ContentAsyncCheck
|
|
|
|
|
{
|
2022-09-09 16:42:55 +08:00
|
|
|
private mixed $_ToUserName = '';
|
|
|
|
|
private mixed $_FromUserName = '';
|
|
|
|
|
private mixed $_CreateTime = '';
|
|
|
|
|
private mixed $_MsgType = '';
|
|
|
|
|
private mixed $_Event = '';
|
|
|
|
|
private mixed $_isrisky = '';
|
|
|
|
|
private mixed $_extra_info_json = '';
|
|
|
|
|
private mixed $_appid = '';
|
|
|
|
|
private mixed $_trace_id = '';
|
|
|
|
|
private mixed $_status_code = '';
|
2019-12-19 15:00:25 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getToUserName(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_ToUserName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getFromUserName(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_FromUserName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getCreateTime(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_CreateTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getMsgType(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_MsgType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getEvent(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_Event;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getIsrisky(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_isrisky;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getExtraInfoJson(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_extra_info_json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getAppid(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_appid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getTraceId(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_trace_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function getStatusCode(): mixed
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_status_code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param array $params
|
2022-09-09 16:42:55 +08:00
|
|
|
* @return ContentAsyncCheck
|
2019-12-19 15:00:25 +08:00
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public static function instance(array $params): static
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
static $class = null;
|
|
|
|
|
if ($class === null) {
|
|
|
|
|
$class = new ContentAsyncCheck();
|
|
|
|
|
}
|
|
|
|
|
return $class->init($params);
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-14 14:10:36 +08:00
|
|
|
/**
|
|
|
|
|
* @param array $params
|
|
|
|
|
* @return $this
|
|
|
|
|
*/
|
|
|
|
|
private function init(array $params): static
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
foreach ($params as $item => $param) {
|
|
|
|
|
$this->{'_' . $item} = $param;
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function isRisky(): bool
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return intval($this->_isrisky) === 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2022-09-09 16:42:55 +08:00
|
|
|
public function isSuccess(): bool
|
2019-12-19 15:00:25 +08:00
|
|
|
{
|
|
|
|
|
return $this->_status_code === 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|