Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
4ece1351
Commit
4ece1351
authored
Mar 12, 2019
by
gary
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、添加ERRORCODEMSG Enum
parent
5a5863cd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
EnumErrorCodeMsg.java
...ava/pwc/taxtech/atms/constant/enums/EnumErrorCodeMsg.java
+40
-0
EbsApiController.java
...in/java/pwc/taxtech/atms/controller/EbsApiController.java
+0
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumErrorCodeMsg.java
0 → 100644
View file @
4ece1351
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumErrorCodeMsg
{
SUCCESS
(
0
,
"成功"
),
APIERROR
(-
1
,
"接口异常"
),
APIDATAEMPTY
(-
2
,
"接口输入数据为空"
);
private
Integer
code
;
private
String
msg
;
EnumErrorCodeMsg
(
Integer
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
static
EnumErrorCodeMsg
fromCode
(
Integer
code
){
for
(
EnumErrorCodeMsg
error:
EnumErrorCodeMsg
.
values
()){
if
(
error
.
getCode
().
intValue
()==
code
.
intValue
())
return
error
;
}
// 超出范围值默认返回异常
return
EnumErrorCodeMsg
.
APIERROR
;
}
public
static
String
getMsg
(
Integer
code
){
for
(
EnumErrorCodeMsg
error:
EnumErrorCodeMsg
.
values
()){
if
(
error
.
getCode
().
intValue
()==
code
.
intValue
())
return
error
.
msg
;
}
// 超出范围值默认返回异常
return
EnumErrorCodeMsg
.
APIERROR
.
msg
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/EbsApiController.java
View file @
4ece1351
This diff is collapsed.
Click to expand it.
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