36 lines
623 B
PHP
36 lines
623 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace wchat\common;
|
||
|
|
|
||
|
|
class NoticeConfig
|
||
|
|
{
|
||
|
|
|
||
|
|
public string $token;
|
||
|
|
public string $encodingAESKey;
|
||
|
|
public string $unionId;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param string $token
|
||
|
|
* @param string $encodingAESKey
|
||
|
|
* @param string $unionId
|
||
|
|
*/
|
||
|
|
public function __construct(string $token, string $encodingAESKey, string $unionId)
|
||
|
|
{
|
||
|
|
$this->token = $token;
|
||
|
|
$this->encodingAESKey = $encodingAESKey;
|
||
|
|
$this->unionId = $unionId;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param array $map
|
||
|
|
* @return static
|
||
|
|
*/
|
||
|
|
public static function parse(array $map): static
|
||
|
|
{
|
||
|
|
return new static($map['token'], $map['secret'], $map['unionId'] ?? '');
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|