Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
7aaf2ac4
Commit
7aaf2ac4
authored
Jul 23, 2018
by
zhufx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
错误类封装
parent
19e34a9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
src/Order/Enum/OrderError.php
+57
-0
No files found.
src/Order/Enum/OrderError.php
0 → 100644
View file @
7aaf2ac4
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/20
* Time: 11:13
*/
namespace
Hdll\Services\Order\Enum
;
class
OrderError
{
//common
const
PARAMETER_ERR
=
[
"msg"
=>
"参数错误"
,
"code"
=>
400
,
"errorCode"
=>
22001
];
const
PERMISSION_DENIED
=
[
"msg"
=>
"没有权限,%s"
,
"code"
=>
401
,
"errorCode"
=>
22104
];
//validator
const
UNDEFINED_VALIDATOR
=
[
"msg"
=>
"未定义验证其验证器%s"
,
"code"
=>
500
,
"errorCode"
=>
22100
];
const
EMPTY_COMPARE_VALUE
=
[
"msg"
=>
"对比数值不能为空"
,
"code"
=>
500
,
"errorCode"
=>
22101
];
const
UNKONW_OPERATION
=
[
"msg"
=>
"未知操作符%s"
,
"code"
=>
500
,
"errorCode"
=>
22102
];
//联系人
const
NO_FOUND_CONSIGNEE
=
[
"msg"
=>
"未找到联系人信息"
,
"code"
=>
404
,
"errorCode"
=>
22103
];
//预约
const
RESERVATION_OVERRUN
=
[
"msg"
=>
"预约时间不能早于当前时间"
,
"code"
=>
400
,
"errorCode"
=>
22105
];
const
RES_IS_REST
=
[
"msg"
=>
"休息日不能添加预约"
,
"code"
=>
400
,
"errorCode"
=>
22106
];
//买家
const
FREEZE
=
[
"msg"
=>
"休息日不能添加预约"
,
"code"
=>
400
,
"errorCode"
=>
22107
];
//order
const
O_PRICE_ABNORMAL
=
[
"msg"
=>
"价格异常,请重新购买"
,
"code"
=>
400
,
"errorCode"
=>
22108
];
const
O_TYPE_ERR
=
[
"msg"
=>
"订单类型不正确"
,
"code"
=>
400
,
"errorCode"
=>
22109
];
public
static
function
atranslate
(
$message
,
$param
)
{
if
(
empty
(
$param
)
)
{
return
$message
;
}
array_unshift
(
$param
,
$message
);
return
sprintf
(
...
$param
);
}
public
function
getError
(
$code
)
{
$reflect
=
new
\ReflectionClass
(
self
::
class
);
return
$reflect
->
getConstant
(
$code
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment