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
c2d1384c
Commit
c2d1384c
authored
Aug 08, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '转web' into 'master'
add See merge request
!3
parents
35376397
d1efce7e
Hide 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 @
c2d1384c
...
...
@@ -47,6 +47,16 @@
</exclusion>
</exclusions>
</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>
<build>
...
...
src/main/java/com/gic/qywx/self/QywxController.java
View file @
c2d1384c
...
...
@@ -10,8 +10,8 @@ import javax.servlet.http.HttpServletRequest;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.entity.mime.content.ByteArrayBody
;
import
org.apache.http.entity.mime.content.ContentBody
;
import
org.
slf4j.Log
ger
;
import
org.
slf4j.LoggerFactory
;
import
org.
apache.logging.log4j.LogMana
ger
;
import
org.
apache.logging.log4j.Logger
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -23,48 +23,44 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
@RequestMapping
(
"/qywx"
)
public
class
QywxController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QywxController
.
class
);
private
Logger
logger
=
LogManager
.
getLogger
(
QywxController
.
class
);
@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
,
ip
);
logger
.
info
(
"自建post,url={},json={},{},{}"
,
url
,
json
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
)
,
ip
);
return
map
;
}
@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
,
ip
);
logger
.
info
(
"自建post json,url={},json={},{},{}"
,
url
,
json
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByJson
(
url
,
json
,
getIp
(
ip
)
,
ip
);
return
map
;
}
@RequestMapping
(
"self-get"
)
public
Object
selfGet
(
HttpServletRequest
request
,
String
url
,
String
ip
)
{
String
traceid
=
request
.
getParameter
(
"tranceid"
)
;
logger
.
info
(
"自建get,url={},{},{}"
,
url
,
traceid
,
ip
);
logger
.
info
(
"自建get,url={},{},{}"
,
url
,
ip
);
Map
<
String
,
Object
>
map
=
HttpClient
.
getHttpByGet
(
url
,
getIp
(
ip
)
,
ip
);
return
map
;
}
@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
,
ip
);
logger
.
info
(
"自建upload,url={},fileUrl={},{},{}"
,
url
,
fileUrl
,
ip
);
byte
[]
data
=
CommonUtil
.
getFileByte
(
fileUrl
);
Map
<
String
,
ContentBody
>
paramsMap
=
new
HashMap
<
String
,
ContentBody
>();
paramsMap
.
put
(
"media"
,
new
ByteArrayBody
(
data
,
ContentType
.
DEFAULT_BINARY
,
fileName
));
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByFile
(
url
,
paramsMap
,
getIp
(
ip
)
,
ip
);
logger
.
info
(
"自建upload end={}"
,
traceid
);
logger
.
info
(
"自建upload end={}"
);
return
map
;
}
@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
,
ip
);
logger
.
info
(
"自建upload-data,url={},{},{}"
,
url
,
ip
);
MultipartHttpServletRequest
multiRequest
=
(
MultipartHttpServletRequest
)
request
;
List
<
MultipartFile
>
list
=
multiRequest
.
getMultiFileMap
().
get
(
"media"
);
MultipartFile
mf
=
list
.
get
(
0
);
...
...
@@ -72,7 +68,7 @@ public class QywxController {
Map
<
String
,
ContentBody
>
paramsMap
=
new
HashMap
<
String
,
ContentBody
>();
paramsMap
.
put
(
"media"
,
new
ByteArrayBody
(
data
,
ContentType
.
DEFAULT_BINARY
,
fileName
));
Map
<
String
,
Object
>
map
=
HttpClient
.
getWinxinResByFile
(
url
,
paramsMap
,
getIp
(
ip
)
,
ip
);
logger
.
info
(
"自建upload-data end={}"
,
traceid
);
logger
.
info
(
"自建upload-data end={}"
);
return
map
;
}
...
...
src/main/webapp/WEB-INF/applicationContext-conf.xml
View file @
c2d1384c
...
...
@@ -4,7 +4,8 @@
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
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=
"dubbo-haoban-self-web.xml"
/>
</beans>
src/main/webapp/WEB-INF/dubbo-haoban-self-web.xml
View file @
c2d1384c
...
...
@@ -9,6 +9,6 @@
http://www.springframework.org/schema/context/spring-context.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>
\ No newline at end of file
src/main/webapp/WEB-INF/spring-servlet.xml
View file @
c2d1384c
...
...
@@ -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"
>
<!-- 扫描注解包路径,多个包用逗号分隔,不填pacakge表示扫描当前ApplicationContext中所有的类 -->
<context:component-scan
base-package=
"com.gic.qywx.*"
/>
<context:component-scan
base-package=
"com.gic.qywx.*"
/>
<!-- 启动对@AspectJ注解的支持 -->
<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