|
@@ -1,11 +1,5 @@
|
|
|
<?php
|
|
|
|
|
|
-/*
|
|
|
- * To change this license header, choose License Headers in Project Properties.
|
|
|
- * To change this template file, choose Tools | Templates
|
|
|
- * and open the template in the editor.
|
|
|
- */
|
|
|
-
|
|
|
/**
|
|
|
* Description of Resp
|
|
|
* 应答体
|
|
@@ -13,51 +7,51 @@
|
|
|
*/
|
|
|
class Resp {
|
|
|
//put your code here
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 应答数据
|
|
|
* @var type
|
|
|
*/
|
|
|
public $data = null;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 错误码
|
|
|
* @var type
|
|
|
*/
|
|
|
public $err = 0;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 错误消息
|
|
|
* @var type
|
|
|
*/
|
|
|
public $errMsg = "";
|
|
|
-
|
|
|
-
|
|
|
- function stringify(){
|
|
|
+
|
|
|
+ function stringify() {
|
|
|
return json_encode($this);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param type $data
|
|
|
* @return \Resp
|
|
|
*/
|
|
|
- static function ret($data){
|
|
|
+ static function ret($data) {
|
|
|
$resp = new Resp();
|
|
|
$resp->data = $data;
|
|
|
return $resp;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param type $err
|
|
|
* @param type $msg
|
|
|
* @return \Resp
|
|
|
*/
|
|
|
- static function err($err, $msg){
|
|
|
+ static function err($err, $msg) {
|
|
|
$resp = new Resp();
|
|
|
$resp->err = $err;
|
|
|
$resp->errMsg = $msg;
|
|
|
return $resp;
|
|
|
}
|
|
|
+
|
|
|
}
|