Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mall
arch
matrix
Commits
bf89d978
Commit
bf89d978
authored
Jul 15, 2021
by
郑冰晶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化BizRepspone、HttpclientUtils
parent
c6ed8153
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
BizResponse.java
common-core/src/main/java/com/secoo/mall/common/core/bean/BizResponse.java
+25
-1
Response.java
common-core/src/main/java/com/secoo/mall/common/core/bean/Response.java
+0
-5
HttpClientUtils.java
common-util/src/main/java/com/secoo/mall/common/util/http/HttpClientUtils.java
+0
-0
No files found.
common-core/src/main/java/com/secoo/mall/common/core/bean/BizResponse.java
View file @
bf89d978
package
com
.
secoo
.
mall
.
common
.
core
.
bean
;
import
com.secoo.mall.common.constant.CommonConstant
;
...
...
@@ -17,9 +18,31 @@ public class BizResponse<T> extends Response<T> {
super
(
code
,
msg
);
}
public
BizResponse
(
Integer
code
,
String
msg
,
T
data
)
{
super
(
code
,
msg
,
data
);
}
public
boolean
isSuccess
()
{
return
getCode
()
!=
null
&&
getCode
()
==
CommonConstant
.
Success
.
CODE
;
return
getCode
()
!=
null
&&
getCode
().
equals
(
CommonConstant
.
Success
.
CODE
);
}
public
static
<
T
>
BizResponse
<
T
>
success
(
Integer
code
,
String
msg
,
T
data
)
{
return
new
BizResponse
<>(
code
,
msg
,
data
);
}
public
static
<
T
>
BizResponse
<
T
>
success
(
Integer
code
,
String
msg
)
{
return
new
BizResponse
<>(
code
,
msg
);
}
public
static
<
T
>
BizResponse
<
T
>
success
(
T
data
)
{
return
new
BizResponse
<>(
CommonConstant
.
Success
.
CODE
,
CommonConstant
.
Success
.
MSG
,
data
);
}
public
static
<
T
>
BizResponse
<
T
>
fail
(
Integer
code
,
String
msg
,
T
data
)
{
return
new
BizResponse
<>(
code
,
msg
,
data
);
}
public
static
<
T
>
BizResponse
<
T
>
fail
(
Integer
code
,
String
msg
)
{
return
new
BizResponse
<>(
code
,
msg
);
}
}
\ No newline at end of file
common-core/src/main/java/com/secoo/mall/common/core/bean/Response.java
View file @
bf89d978
package
com
.
secoo
.
mall
.
common
.
core
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
/**
...
...
@@ -10,8 +7,6 @@ import java.io.Serializable;
*
* @param <T>
*/
@Getter
@Setter
public
class
Response
<
T
>
implements
Serializable
{
private
Integer
code
;
...
...
common-util/src/main/java/com/secoo/mall/common/util/http/HttpClientUtils.java
View file @
bf89d978
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