first commit
This commit is contained in:
41
app/Rpc/RpcResponse.php
Executable file
41
app/Rpc/RpcResponse.php
Executable file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Rpc;
|
||||
|
||||
class RpcResponse
|
||||
{
|
||||
public int $code = 0;
|
||||
public string $msg = 'ok';
|
||||
public array $data = [];
|
||||
public array $meta = [];
|
||||
public string $title = '';
|
||||
public array $pageModule = [];
|
||||
|
||||
|
||||
public function setData(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCode(int $code)
|
||||
{
|
||||
$this->code = $code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setMsg(string $message)
|
||||
{
|
||||
$this->msg = $message;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function send()
|
||||
{
|
||||
return [
|
||||
'code' => $this->code,
|
||||
'msg' => $this->msg,
|
||||
'data' => $this->data,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user