Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-qywx-self
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
gic-qywx-self
Commits
14ea63ab
Commit
14ea63ab
authored
Jun 20, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
3a21adbc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
HttpClient.java
src/main/java/com/gic/qywx/self/HttpClient.java
+2
-0
QywxController.java
src/main/java/com/gic/qywx/self/QywxController.java
+5
-6
No files found.
src/main/java/com/gic/qywx/self/HttpClient.java
View file @
14ea63ab
...
...
@@ -277,6 +277,8 @@ public class HttpClient {
try
{
if
(
null
!=
ip
)
{
client
.
getParams
().
setParameter
(
ConnRouteParams
.
LOCAL_ADDRESS
,
InetAddress
.
getByAddress
(
ip
))
;
}
else
{
logger
.
info
(
"IP为空"
);
}
}
catch
(
UnknownHostException
e2
)
{
// TODO Auto-generated catch block
...
...
src/main/java/com/gic/qywx/self/QywxController.java
View file @
14ea63ab
...
...
@@ -28,7 +28,7 @@ public class QywxController {
@RequestMapping
(
"self-post"
)
public
Object
selfPost
(
HttpServletRequest
request
,
String
url
,
String
json
,
String
ip
)
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建post,url={},json={},{}
"
,
url
,
json
,
traceid
);
logger
.
info
(
"自建post,url={},json={},{}
,{}"
,
url
,
json
,
traceid
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
));
return
map
;
}
...
...
@@ -36,7 +36,7 @@ public class QywxController {
@RequestMapping
(
"self-post-json"
)
public
Object
selfPostJson
(
HttpServletRequest
request
,
String
url
,
@RequestBody
String
json
,
String
ip
)
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建post json,url={},json={},{}
"
,
url
,
json
,
traceid
);
logger
.
info
(
"自建post json,url={},json={},{}
,{}"
,
url
,
json
,
traceid
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
));
return
map
;
}
...
...
@@ -44,7 +44,7 @@ public class QywxController {
@RequestMapping
(
"self-get"
)
public
Object
selfGet
(
HttpServletRequest
request
,
String
url
,
String
ip
)
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建get,url={},{}
"
,
url
,
traceid
);
logger
.
info
(
"自建get,url={},{}
,{}"
,
url
,
traceid
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getHttpByGet
(
url
,
getIp
(
ip
));
return
map
;
}
...
...
@@ -52,7 +52,7 @@ public class QywxController {
@RequestMapping
(
"self-upload"
)
public
Object
selfUpload
(
HttpServletRequest
request
,
String
url
,
String
fileUrl
,
String
fileName
,
String
ip
)
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建upload,url={},fileUrl={},{}
"
,
url
,
fileUrl
,
traceid
);
logger
.
info
(
"自建upload,url={},fileUrl={},{}
,{}"
,
url
,
fileUrl
,
traceid
,
ip
);
byte
[]
data
=
CommonUtil
.
getFileByte
(
fileUrl
);
Map
<
String
,
ContentBody
>
paramsMap
=
new
HashMap
<
String
,
ContentBody
>();
paramsMap
.
put
(
"media"
,
new
ByteArrayBody
(
data
,
ContentType
.
DEFAULT_BINARY
,
fileName
));
...
...
@@ -64,7 +64,7 @@ public class QywxController {
@RequestMapping
(
"self-upload-data"
)
public
Object
selfImage
(
HttpServletRequest
request
,
String
url
,
String
fileName
,
String
ip
)
throws
IOException
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建upload-data,url={},{}
"
,
url
,
traceid
);
logger
.
info
(
"自建upload-data,url={},{}
,{}"
,
url
,
traceid
,
ip
);
MultipartHttpServletRequest
multiRequest
=
(
MultipartHttpServletRequest
)
request
;
List
<
MultipartFile
>
list
=
multiRequest
.
getMultiFileMap
().
get
(
"media"
);
MultipartFile
mf
=
list
.
get
(
0
);
...
...
@@ -78,7 +78,6 @@ public class QywxController {
// 必须是内网ip
private
byte
[]
getIp
(
String
ip
)
{
logger
.
info
(
"ip={}"
,
ip
);
if
(
StringUtils
.
isEmpty
(
ip
))
{
return
null
;
}
...
...
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