-
Notifications
You must be signed in to change notification settings - Fork 0
/
SyncWeChat.php
53 lines (39 loc) · 1.07 KB
/
SyncWeChat.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace xing\contentSafe;
use EasyWeChat\Factory;
use xing\contentSafe\core\BaseAli;
use xing\contentSafe\core\ImageSafeInterFace;
/**
* Class SyncWeChat
* @property $device
* @property string $access_token
* @package xing\contentSafe
*/
class SyncWeChat extends BaseAli implements ImageSafeInterFace
{
public $access_token;
/**
* @return \EasyWeChat\BasicService\ContentSecurity\Client
*/
public function getService()
{
$this->device = Factory::miniProgram($this->config);
return $this->device->content_security;
}
public function getTextInfo(array $contents, $taskIds = '')
{
$service = $this->getService();
$result = [];
foreach ($contents as $content) {
$result[0][] = $this->checkResult($service->checkText($content));
}
return $result;
}
public function getImageInfo(array $urls, $taskIds = '')
{
}
private function checkResult($result)
{
return $result['errcode'] == 0 ? static::CHECK_OK : static::CHECK_SERIOUS;
}
}