34 lines
675 B
PHP
34 lines
675 B
PHP
<?php
|
||
/*
|
||
* description:
|
||
* author:wh
|
||
* email:
|
||
* createTime:{2024/4/5} {19:55}
|
||
*/
|
||
|
||
namespace app\api\controller;
|
||
|
||
|
||
class BaseWssApi extends BaseCommonController
|
||
{
|
||
|
||
/**
|
||
* desc:socket专用json格式
|
||
*
|
||
* author:wh
|
||
* @param $action
|
||
* @param string $msg
|
||
* @param array $items
|
||
* @param string $method
|
||
* @return false|string
|
||
*/
|
||
static function json_wss($action,$msg='', $items=[], $method='response'){
|
||
$json = [
|
||
'action'=>$action,
|
||
'method'=>$method,
|
||
'msg'=>$msg,
|
||
'items'=>$items
|
||
];
|
||
return json_encode($json, JSON_UNESCAPED_UNICODE);
|
||
}
|
||
} |