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
d1efce7e
Commit
d1efce7e
authored
Aug 08, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
fe15e4ff
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
18 deletions
+26
-18
pom.xml
pom.xml
+10
-0
QywxController.java
src/main/java/com/gic/qywx/self/QywxController.java
+11
-15
applicationContext-conf.xml
src/main/webapp/WEB-INF/applicationContext-conf.xml
+2
-1
dubbo-haoban-self-web.xml
src/main/webapp/WEB-INF/dubbo-haoban-self-web.xml
+2
-1
spring-servlet.xml
src/main/webapp/WEB-INF/spring-servlet.xml
+1
-1
No files found.
pom.xml
View file @
d1efce7e
...
@@ -47,6 +47,16 @@
...
@@ -47,6 +47,16 @@
</exclusion>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-platform-config
</artifactId>
<version>
${gic-platform-config}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-commons
</artifactId>
<version>
${gic-commons}
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
src/main/java/com/gic/qywx/self/QywxController.java
View file @
d1efce7e
...
@@ -10,8 +10,8 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -10,8 +10,8 @@ import javax.servlet.http.HttpServletRequest;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.entity.mime.content.ByteArrayBody
;
import
org.apache.http.entity.mime.content.ByteArrayBody
;
import
org.apache.http.entity.mime.content.ContentBody
;
import
org.apache.http.entity.mime.content.ContentBody
;
import
org.
slf4j.Log
ger
;
import
org.
apache.logging.log4j.LogMana
ger
;
import
org.
slf4j.LoggerFactory
;
import
org.
apache.logging.log4j.Logger
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -23,48 +23,44 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
...
@@ -23,48 +23,44 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
@RequestMapping
(
"/qywx"
)
@RequestMapping
(
"/qywx"
)
public
class
QywxController
{
public
class
QywxController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QywxController
.
class
);
private
Logger
logger
=
LogManager
.
getLogger
(
QywxController
.
class
);
@RequestMapping
(
"self-post"
)
@RequestMapping
(
"self-post"
)
public
Object
selfPost
(
HttpServletRequest
request
,
String
url
,
String
json
,
String
ip
)
{
public
Object
selfPost
(
HttpServletRequest
request
,
String
url
,
String
json
,
String
ip
)
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建post,url={},json={},{},{}"
,
url
,
json
,
ip
);
logger
.
info
(
"自建post,url={},json={},{},{}"
,
url
,
json
,
traceid
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
)
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
)
,
ip
);
return
map
;
return
map
;
}
}
@RequestMapping
(
"self-post-json"
)
@RequestMapping
(
"self-post-json"
)
public
Object
selfPostJson
(
HttpServletRequest
request
,
String
url
,
@RequestBody
String
json
,
String
ip
)
{
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
,
ip
);
logger
.
info
(
"自建post json,url={},json={},{},{}"
,
url
,
json
,
traceid
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
)
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
)
,
ip
);
return
map
;
return
map
;
}
}
@RequestMapping
(
"self-get"
)
@RequestMapping
(
"self-get"
)
public
Object
selfGet
(
HttpServletRequest
request
,
String
url
,
String
ip
)
{
public
Object
selfGet
(
HttpServletRequest
request
,
String
url
,
String
ip
)
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建get,url={},{},{}"
,
url
,
ip
);
logger
.
info
(
"自建get,url={},{},{}"
,
url
,
traceid
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getHttpByGet
(
url
,
getIp
(
ip
)
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getHttpByGet
(
url
,
getIp
(
ip
)
,
ip
);
return
map
;
return
map
;
}
}
@RequestMapping
(
"self-upload"
)
@RequestMapping
(
"self-upload"
)
public
Object
selfUpload
(
HttpServletRequest
request
,
String
url
,
String
fileUrl
,
String
fileName
,
String
ip
)
{
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
,
ip
);
logger
.
info
(
"自建upload,url={},fileUrl={},{},{}"
,
url
,
fileUrl
,
traceid
,
ip
);
byte
[]
data
=
CommonUtil
.
getFileByte
(
fileUrl
);
byte
[]
data
=
CommonUtil
.
getFileByte
(
fileUrl
);
Map
<
String
,
ContentBody
>
paramsMap
=
new
HashMap
<
String
,
ContentBody
>();
Map
<
String
,
ContentBody
>
paramsMap
=
new
HashMap
<
String
,
ContentBody
>();
paramsMap
.
put
(
"media"
,
new
ByteArrayBody
(
data
,
ContentType
.
DEFAULT_BINARY
,
fileName
));
paramsMap
.
put
(
"media"
,
new
ByteArrayBody
(
data
,
ContentType
.
DEFAULT_BINARY
,
fileName
));
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByFile
(
url
,
paramsMap
,
getIp
(
ip
)
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByFile
(
url
,
paramsMap
,
getIp
(
ip
)
,
ip
);
logger
.
info
(
"自建upload end={}"
,
traceid
);
logger
.
info
(
"自建upload end={}"
);
return
map
;
return
map
;
}
}
@RequestMapping
(
"self-upload-data"
)
@RequestMapping
(
"self-upload-data"
)
public
Object
selfImage
(
HttpServletRequest
request
,
String
url
,
String
fileName
,
String
ip
)
throws
IOException
{
public
Object
selfImage
(
HttpServletRequest
request
,
String
url
,
String
fileName
,
String
ip
)
throws
IOException
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建upload-data,url={},{},{}"
,
url
,
ip
);
logger
.
info
(
"自建upload-data,url={},{},{}"
,
url
,
traceid
,
ip
);
MultipartHttpServletRequest
multiRequest
=
(
MultipartHttpServletRequest
)
request
;
MultipartHttpServletRequest
multiRequest
=
(
MultipartHttpServletRequest
)
request
;
List
<
MultipartFile
>
list
=
multiRequest
.
getMultiFileMap
().
get
(
"media"
);
List
<
MultipartFile
>
list
=
multiRequest
.
getMultiFileMap
().
get
(
"media"
);
MultipartFile
mf
=
list
.
get
(
0
);
MultipartFile
mf
=
list
.
get
(
0
);
...
@@ -72,7 +68,7 @@ public class QywxController {
...
@@ -72,7 +68,7 @@ public class QywxController {
Map
<
String
,
ContentBody
>
paramsMap
=
new
HashMap
<
String
,
ContentBody
>();
Map
<
String
,
ContentBody
>
paramsMap
=
new
HashMap
<
String
,
ContentBody
>();
paramsMap
.
put
(
"media"
,
new
ByteArrayBody
(
data
,
ContentType
.
DEFAULT_BINARY
,
fileName
));
paramsMap
.
put
(
"media"
,
new
ByteArrayBody
(
data
,
ContentType
.
DEFAULT_BINARY
,
fileName
));
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByFile
(
url
,
paramsMap
,
getIp
(
ip
)
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByFile
(
url
,
paramsMap
,
getIp
(
ip
)
,
ip
);
logger
.
info
(
"自建upload-data end={}"
,
traceid
);
logger
.
info
(
"自建upload-data end={}"
);
return
map
;
return
map
;
}
}
...
...
src/main/webapp/WEB-INF/applicationContext-conf.xml
View file @
d1efce7e
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
>
http://www.springframework.org/schema/beans/spring-beans.xsd"
>
<import
resource=
"
dubbo-haoban-self-web
.xml"
/>
<import
resource=
"
classpath*:applicationContext-init
.xml"
/>
<import
resource=
"classpath*:dubbo-setting.xml"
/>
<import
resource=
"classpath*:dubbo-setting.xml"
/>
<import
resource=
"dubbo-haoban-self-web.xml"
/>
</beans>
</beans>
src/main/webapp/WEB-INF/dubbo-haoban-self-web.xml
View file @
d1efce7e
...
@@ -9,6 +9,6 @@
...
@@ -9,6 +9,6 @@
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/context/spring-context.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"
>
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"
>
<dubbo:application
name=
"
haoban-selft-web
"
/>
<dubbo:application
name=
"
gic-qywx-self
"
/>
</beans>
</beans>
\ No newline at end of file
src/main/webapp/WEB-INF/spring-servlet.xml
View file @
d1efce7e
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
>
http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
>
<!-- 扫描注解包路径,多个包用逗号分隔,不填pacakge表示扫描当前ApplicationContext中所有的类 -->
<!-- 扫描注解包路径,多个包用逗号分隔,不填pacakge表示扫描当前ApplicationContext中所有的类 -->
<context:component-scan
base-package=
"com.gic.qywx.*"
/>
<context:component-scan
base-package=
"com.gic.qywx.*"
/>
<!-- 启动对@AspectJ注解的支持 -->
<!-- 启动对@AspectJ注解的支持 -->
<aop:aspectj-autoproxy/>
<aop:aspectj-autoproxy/>
...
...
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