Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
common
Commits
296878ee
Commit
296878ee
authored
Dec 11, 2019
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉system.out.prinltn
parent
770e81c5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
HttpsUtil.java
src/main/java/com/egolm/common/HttpsUtil.java
+1
-1
MD5Util.java
src/main/java/com/egolm/common/MD5Util.java
+7
-8
No files found.
src/main/java/com/egolm/common/HttpsUtil.java
View file @
296878ee
...
@@ -144,13 +144,13 @@ public class HttpsUtil {
...
@@ -144,13 +144,13 @@ public class HttpsUtil {
}
}
public
static
String
post
(
String
requestUrl
,
Map
<
String
,
Object
>
parameters
,
Map
<
String
,
String
>
headers
,
SSLSocketFactory
sslSocketFactory
,
Proxy
proxy
)
throws
HttpRequestException
{
public
static
String
post
(
String
requestUrl
,
Map
<
String
,
Object
>
parameters
,
Map
<
String
,
String
>
headers
,
SSLSocketFactory
sslSocketFactory
,
Proxy
proxy
)
throws
HttpRequestException
{
System
.
out
.
println
(
"----"
+
HttpUtil
.
toQueryString
(
parameters
));
return
HttpsUtil
.
post
(
requestUrl
,
HttpUtil
.
toQueryString
(
parameters
),
headers
,
sslSocketFactory
,
proxy
);
return
HttpsUtil
.
post
(
requestUrl
,
HttpUtil
.
toQueryString
(
parameters
),
headers
,
sslSocketFactory
,
proxy
);
}
}
public
static
String
post
(
String
requestUrl
,
String
text
,
Map
<
String
,
String
>
headers
,
SSLSocketFactory
sslSocketFactory
,
Proxy
proxy
)
throws
HttpRequestException
{
public
static
String
post
(
String
requestUrl
,
String
text
,
Map
<
String
,
String
>
headers
,
SSLSocketFactory
sslSocketFactory
,
Proxy
proxy
)
throws
HttpRequestException
{
HttpsURLConnection
connection
=
null
;
HttpsURLConnection
connection
=
null
;
try
{
try
{
System
.
out
.
println
(
"requestUrl--"
+
requestUrl
);
byte
[]
bytes
=
text
==
null
?
new
byte
[
0
]
:
text
.
getBytes
();
byte
[]
bytes
=
text
==
null
?
new
byte
[
0
]
:
text
.
getBytes
();
URL
POST_URL
=
new
URL
(
requestUrl
);
URL
POST_URL
=
new
URL
(
requestUrl
);
connection
=
(
HttpsURLConnection
)
(
proxy
==
null
?
POST_URL
.
openConnection
()
:
POST_URL
.
openConnection
(
proxy
));
connection
=
(
HttpsURLConnection
)
(
proxy
==
null
?
POST_URL
.
openConnection
()
:
POST_URL
.
openConnection
(
proxy
));
...
...
src/main/java/com/egolm/common/MD5Util.java
View file @
296878ee
...
@@ -26,7 +26,6 @@ public class MD5Util {
...
@@ -26,7 +26,6 @@ public class MD5Util {
String
k
=
(
String
)
entry
.
getKey
();
String
k
=
(
String
)
entry
.
getKey
();
Object
v
=
entry
.
getValue
();
Object
v
=
entry
.
getValue
();
if
(
null
!=
v
&&
!
""
.
equals
(
v
)&&
!
"sign"
.
equals
(
k
)
)
{
if
(
null
!=
v
&&
!
""
.
equals
(
v
)&&
!
"sign"
.
equals
(
k
)
)
{
System
.
out
.
println
(
k
+
"---"
+
v
);
sb
.
append
(
k
+
"="
+
v
+
"&"
);
sb
.
append
(
k
+
"="
+
v
+
"&"
);
}
}
}
}
...
@@ -78,12 +77,12 @@ public class MD5Util {
...
@@ -78,12 +77,12 @@ public class MD5Util {
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<
Object
,
Object
>
();
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<
Object
,
Object
>
();
parameters
.
put
(
"AppID"
,
"
E34EAAAFCC714ABA
"
);
parameters
.
put
(
"AppID"
,
"
201909230001
"
);
parameters
.
put
(
"AppKey"
,
"
F7FC3382E34EAAAFCC714ABA172FD00C
"
);
parameters
.
put
(
"AppKey"
,
"
d0dd209596922ae29630ded8ba46f15f
"
);
parameters
.
put
(
"
LangID"
,
"936"
);
parameters
.
put
(
"
ServerID"
,
"ThirdAgentOnStockAdd"
);
parameters
.
put
(
"Server
ID"
,
"Scan_CheckMemPointCoupon"
);
parameters
.
put
(
"Server
TypeID"
,
3
);
parameters
.
put
(
"
ServerTypeID"
,
1
);
parameters
.
put
(
"
timestamp"
,
"1569310600084"
);
parameters
.
put
(
"
timestamp"
,
"1560474936524
"
);
parameters
.
put
(
"
data"
,
"{\"dataList_0\": [{\"AgentContractNO\": \"600022001\",\"AgentID\": 22,\"WarehouseNO\": \"002\"}],\"dataList_1\": [{\"AgentContractNO\": \"600022001\",\"GoodsID\": 22,\"StockQty\": \"002\",\"CostPrice\":0 },{\"AgentContractNO\": \"600022001\",\"GoodsID\": 22,\"StockQty\": \"002\",\"CostPrice\":0}]}
"
);
System
.
out
.
println
(
parameters
);
System
.
out
.
println
(
parameters
);
String
createSign
=
MD5Util
.
createSign
(
"UTF-8"
,
parameters
);
String
createSign
=
MD5Util
.
createSign
(
"UTF-8"
,
parameters
);
System
.
out
.
println
(
createSign
);
System
.
out
.
println
(
createSign
);
...
...
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