12345678910111213141516171819202122232425262728 |
- <?php
- namespace Common\Server;
- /**
- * Description of ItemServer
- *
- */
- class BaseServer {
-
- public function __construct() {
-
- }
- public function apiSuccess($param) {
- $ret['code'] = API_SUCCESS;
- $ret['data'] = $param;
- header('Content-Type:application/json; charset=utf-8');
- return $this->jsonEncode($ret);
- }
- public function apiError($type, $msg,$param=array()) {
- $ret['code'] = $type;
- $ret['msg'] =trim($msg);
- $ret= array_merge($ret,$param);
- header('Content-Type:application/json; charset=utf-8');
- return $this->jsonEncode($ret);
- }
- }
|