12345678910111213141516171819202122232425262728 |
- <?php
- /**
- * qq: 1123416584
- * Time: 2022/4/1 11:46 上午
- */
- namespace addons\notice\library;
- use GatewayClient\Gateway;
- class GatewayTool
- {
- public static function init()
- {
- $register_port = get_addon_config('notice')['register_port'] ?? '';
- Gateway::$registerAddress = '127.0.0.1:'.$register_port;
- }
- public static function sendByUid($uid, $type, $data)
- {
- $data = [
- 'type' => $type,
- 'data' => $data,
- ];
- Gateway::sendToUid($uid, json_encode($data, true));
- }
- }
|