Refactor ChatConnect and related classes to use dynamic typing for properties and method parameters. Update event handling to use a consistent naming convention for emitted events. Adjust WebSocket message handling methods to accept event arrays instead of specific data structures. Update configuration for Swoole to increase ping intervals and timeouts.
This commit is contained in:
@@ -28,7 +28,7 @@ class ChatSession extends Model
|
||||
/**
|
||||
* 获取用户活跃会话
|
||||
*/
|
||||
public static function getActiveByUserId(int $userId): ?array
|
||||
public static function getActiveByUserId($userId)
|
||||
{
|
||||
$session = self::where('user_id', $userId)
|
||||
->whereIn('status', [self::STATUS_PENDING, self::STATUS_ACTIVE])
|
||||
@@ -39,7 +39,7 @@ class ChatSession extends Model
|
||||
/**
|
||||
* 获取客服进行中的会话列表
|
||||
*/
|
||||
public static function getActiveByAdminId(int $adminId): array
|
||||
public static function getActiveByAdminId($adminId)
|
||||
{
|
||||
return self::where('admin_id', $adminId)
|
||||
->where('status', self::STATUS_ACTIVE)
|
||||
@@ -51,7 +51,7 @@ class ChatSession extends Model
|
||||
/**
|
||||
* 获取待分配会话数量
|
||||
*/
|
||||
public static function getPendingCount(): int
|
||||
public static function getPendingCount()
|
||||
{
|
||||
return self::where('status', self::STATUS_PENDING)->count();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user