This commit is contained in:
2025-11-18 09:37:05 +08:00
parent 61b2ccf106
commit a3e5568f93
27 changed files with 1055 additions and 46 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace extend\chat\model;
use GatewayWorker\Lib\Gateway;
use extend\chat\model\OnbocChat;
use extend\chat\model\ShoppingChat;
class Base
{
public function handles($client_id, $message)
{
if(empty($message['type']) || empty($message['operate_type']) || empty($message['user_id']) || empty($message['shop_id'])) {
Gateway::sendToClient($client_id, json_encode(['msg' => '参数不完整']));
return;
}
call_user_func_array(['extend\chat\model\\' . $message['type'], $message['operate_type']], [$client_id, $message]);
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace extend\chat\model;
use ba\Exception;
use ba\Random;
use support\Redis;
use support\think\Db;
use GatewayWorker\Lib\Gateway;
use support\Log;
use think\Model;
/**
* 管理端小程序
*/
class OnbocChat extends Base
{
// 初始化
public static function init(string $client_id, array $message):void
{
print_r(date('H:i:s') . '--初始化运营聊天' . $client_id . $client_id . "\r\n");
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace extend\chat\model;
use Exception;
use ba\Random;
use support\Redis;
use support\think\Db;
use GatewayWorker\Lib\Gateway;
use support\Log;
/**
* 用户端
*/
class ShoppingChat extends Base
{
// 初始化
public static function init(string $client_id, array $message):void
{
print_r( date('H:i:s') . '--初始化运用户聊天' . $client_id . "\r\n");
}
}