43 lines
689 B
PHP
43 lines
689 B
PHP
<?php
|
|
/*
|
|
* Copyright (c) 2021. www.Hura.vn
|
|
*/
|
|
|
|
namespace Hura8\Interfaces;
|
|
|
|
|
|
class APIResponse
|
|
{
|
|
private $errCode = 0;
|
|
private $msg = '';
|
|
private $data;
|
|
|
|
public function __construct($errCode = 0, $msg = '', $data = null) {
|
|
$this->errCode = $errCode;
|
|
$this->msg = $msg;
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getCode() {
|
|
return $this->errCode;
|
|
}
|
|
|
|
/**
|
|
* @return mixed if status = 'error'
|
|
*/
|
|
public function getMsg() {
|
|
return $this->msg;
|
|
}
|
|
|
|
/**
|
|
* @return mixed if status = 'ok'
|
|
*/
|
|
public function getData() {
|
|
return $this->data;
|
|
}
|
|
|
|
}
|