c
This commit is contained in:
42
inc/Hura8/Interfaces/APIResponse.php
Normal file
42
inc/Hura8/Interfaces/APIResponse.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user