You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
878 B
44 lines
878 B
<?php |
|
|
|
namespace app\hejiang; |
|
|
|
/** |
|
* Structured HTTP API Response Class |
|
* |
|
* @property int $code |
|
* @property string $msg |
|
* @property array|object $data |
|
*/ |
|
class ApiResponse extends BaseApiResponse |
|
{ |
|
public function __construct($code, $msg = '', $data = []){ |
|
parent::__construct(); |
|
$this->code = $code; |
|
$this->msg = $msg; |
|
$this->data = $data; |
|
} |
|
|
|
public function getCode(){ |
|
return $this->raw['code']; |
|
} |
|
|
|
public function getMsg(){ |
|
return $this->raw['msg']; |
|
} |
|
|
|
public function getData(){ |
|
return $this->raw['data']; |
|
} |
|
|
|
protected function setCode($v){ |
|
$this->raw['code'] = $v; |
|
} |
|
|
|
protected function setMsg($v){ |
|
$this->raw['msg'] = $v; |
|
} |
|
|
|
protected function setData($v){ |
|
$this->raw['data'] = $v; |
|
} |
|
} |