first commit
This commit is contained in:
56
pgserver/application/util/ReturnCode.php
Normal file
56
pgserver/application/util/ReturnCode.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* 错误码统一维护
|
||||
* @since 2017/02/28 创建
|
||||
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||||
*/
|
||||
|
||||
namespace app\util;
|
||||
|
||||
class ReturnCode {
|
||||
|
||||
const SUCCESS = 1;
|
||||
const INVALID = -1;
|
||||
const DB_SAVE_ERROR = -2;
|
||||
const DB_READ_ERROR = -3;
|
||||
const CACHE_SAVE_ERROR = -4;
|
||||
const CACHE_READ_ERROR = -5;
|
||||
const FILE_SAVE_ERROR = -6;
|
||||
const LOGIN_ERROR = -7;
|
||||
const NOT_EXISTS = -8;
|
||||
const JSON_PARSE_FAIL = -9;
|
||||
const TYPE_ERROR = -10;
|
||||
const NUMBER_MATCH_ERROR = -11;
|
||||
const EMPTY_PARAMS = -12;
|
||||
const DATA_EXISTS = -13;
|
||||
const AUTH_ERROR = -14;
|
||||
|
||||
const OTHER_LOGIN = -16;
|
||||
const VERSION_INVALID = -17;
|
||||
|
||||
const CURL_ERROR = -18;
|
||||
|
||||
const RECORD_NOT_FOUND = -19; // 记录未找到
|
||||
const DELETE_FAILED = -20; // 删除失败
|
||||
const ADD_FAILED = -21; // 添加记录失败
|
||||
const UPDATE_FAILED = -22; // 添加记录失败
|
||||
|
||||
const PARAM_INVALID = -995; // 参数无效
|
||||
const ACCESS_TOKEN_TIMEOUT = -996;
|
||||
const SESSION_TIMEOUT = -997;
|
||||
const UNKNOWN = -998;
|
||||
const EXCEPTION = -999;
|
||||
const WITHDRAWAL = -888;//未满足撤单条件
|
||||
|
||||
const AUTH_PARAMETER = -4001; //缺少参数
|
||||
const AUTH_TOKEN = -4002; //获取token失败
|
||||
const AUTH_USER_TOKEN = -4003; //缺少token参数
|
||||
const AUTH_USER = -4004; //获取用户权限失败
|
||||
const AUTH_ROLE = -4005; //获取角色用户失败
|
||||
|
||||
static public function getConstants() {
|
||||
$oClass = new \ReflectionClass(__CLASS__);
|
||||
return $oClass->getConstants();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user