41 lines
761 B
PHP
Executable File
41 lines
761 B
PHP
Executable File
<?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,
|
|
];
|
|
}
|
|
} |