docker-webman-jsonrpc/app/biz/ResCode.php

35 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace app\biz;
class ResCode
{
const ERROR = 0; // 系统错误
const SUCCESS = 200; // 正确
const FAILED = -1; // 通用一般错误
const HEARTBEAT = 1; // 自定义1表示心跳消息可忽略
const INTERNAL_ERROR = 500; // 500错误
const LOGIN_FAILED = 301; // 自定义301表示登录失败
const NOT_LOGGED = 306; // 自定义306表示未登录
const NOT_ALLOWED = 308; // 自定义308表示没有权限
const TOKEN_ERROR = 309; // 自定义309错误表示token失效
const TIMEOUT = 400; // 400超时
const NOT_FOUND = 404; // 404错误
const NO_DATA = 407; // 自定义407表示数据不存在
const NO_CHANGE = 408; // 自定义408表示无数据变化
const CODE_MESSAGES = [
self::ERROR => '内部错误',
self::SUCCESS => '操作成功',
self::FAILED => '操作失败',
self::NOT_LOGGED => '用户未登录',
self::HEARTBEAT => '心跳',
self::NOT_ALLOWED => '没有权限',
self::NOT_FOUND => '请求路径不正确',
self::INTERNAL_ERROR => '系统错误',
self::NO_DATA => '数据不存在',
self::LOGIN_FAILED => '登录失败',
self::NO_CHANGE => '无数据变化',
self::TOKEN_ERROR => '令牌无效',
self::TIMEOUT => '超时',
];
}