Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-yunqueyilian
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.wechat
pica-cloud-yunqueyilian
提交
465a85e3
提交
465a85e3
编写于
8月 21, 2018
作者:
chenzhehao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
30a67a98
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
7 行删除
+6
-7
PicaLogAspectForXml.java
...d/wechat/yunqueyilian/common/aop/PicaLogAspectForXml.java
+6
-7
未找到文件。
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/aop/PicaLogAspectForXml.java
浏览文件 @
465a85e3
...
@@ -54,7 +54,7 @@ public class PicaLogAspectForXml {
...
@@ -54,7 +54,7 @@ public class PicaLogAspectForXml {
ServletRequestAttributes
sra
=
(
ServletRequestAttributes
)
ra
;
ServletRequestAttributes
sra
=
(
ServletRequestAttributes
)
ra
;
HttpServletRequest
request
=
sra
.
getRequest
();
HttpServletRequest
request
=
sra
.
getRequest
();
this
.
request
.
set
(
request
);
this
.
request
.
set
(
request
);
this
.
contentType
.
set
(
request
.
getHeader
(
"Content-Type"
)
);
this
.
contentType
.
set
(
StringUtil
.
isNotNull
(
request
.
getHeader
(
"Content-Type"
))
?
request
.
getHeader
(
"Content-Type"
)
:
""
);
String
url
=
request
.
getRequestURL
().
toString
();
String
url
=
request
.
getRequestURL
().
toString
();
String
method
=
request
.
getMethod
();
String
method
=
request
.
getMethod
();
String
uri
=
request
.
getRequestURI
();
String
uri
=
request
.
getRequestURI
();
...
@@ -72,11 +72,11 @@ public class PicaLogAspectForXml {
...
@@ -72,11 +72,11 @@ public class PicaLogAspectForXml {
logger
.
info
(
"request start, controller params==>, url: {}, method: {}, uri: {}, params: {}"
,
new
Object
[]{
url
,
method
,
uri
,
queryString
});
logger
.
info
(
"request start, controller params==>, url: {}, method: {}, uri: {}, params: {}"
,
new
Object
[]{
url
,
method
,
uri
,
queryString
});
Object
result
=
pjp
.
proceed
();
Object
result
=
pjp
.
proceed
();
String
res
=
""
;
String
res
=
""
;
if
(
this
.
contentType
.
get
().
equals
(
"text/xml"
))
{
if
(
"text/xml"
.
equals
(
this
.
contentType
.
get
()
))
{
if
(
StringUtil
.
isNotNull
(
result
)){
if
(
StringUtil
.
isNotNull
(
result
))
{
res
=
result
.
toString
();
res
=
result
.
toString
();
}
}
}
else
if
(
this
.
contentType
.
get
().
equals
(
"application/json"
))
{
}
else
{
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
res
=
gson
.
toJson
(
result
);
res
=
gson
.
toJson
(
result
);
}
}
...
@@ -89,7 +89,7 @@ public class PicaLogAspectForXml {
...
@@ -89,7 +89,7 @@ public class PicaLogAspectForXml {
}
}
protected
Map
<
String
,
Object
>
getBeanFromJsonBody
()
throws
Exception
{
protected
Map
<
String
,
Object
>
getBeanFromJsonBody
()
throws
Exception
{
if
(
this
.
contentType
.
get
().
equals
(
"text/xml"
))
{
if
(
"text/xml"
.
equals
(
this
.
contentType
.
get
()
))
{
// 读取输入流
// 读取输入流
SAXReader
reader
=
new
SAXReader
();
SAXReader
reader
=
new
SAXReader
();
org
.
dom4j
.
Document
document
=
reader
.
read
(
this
.
request
.
get
().
getInputStream
());
org
.
dom4j
.
Document
document
=
reader
.
read
(
this
.
request
.
get
().
getInputStream
());
...
@@ -101,12 +101,11 @@ public class PicaLogAspectForXml {
...
@@ -101,12 +101,11 @@ public class PicaLogAspectForXml {
for
(
Element
e
:
elementList
)
for
(
Element
e
:
elementList
)
map
.
put
(
e
.
getName
(),
e
.
getText
());
map
.
put
(
e
.
getName
(),
e
.
getText
());
return
map
;
return
map
;
}
else
if
(
this
.
contentType
.
get
().
equals
(
"application/json"
))
{
}
else
{
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
return
(
Map
)
gson
.
fromJson
(
IOUtils
.
toString
(
new
InputStreamReader
(((
HttpServletRequest
)
this
.
request
.
get
()).
getInputStream
(),
"utf-8"
)),
(
new
TypeToken
<
Map
<
String
,
Object
>>()
{
return
(
Map
)
gson
.
fromJson
(
IOUtils
.
toString
(
new
InputStreamReader
(((
HttpServletRequest
)
this
.
request
.
get
()).
getInputStream
(),
"utf-8"
)),
(
new
TypeToken
<
Map
<
String
,
Object
>>()
{
}).
getType
());
}).
getType
());
}
}
return
null
;
}
}
protected
boolean
parseMultipart
()
throws
Exception
{
protected
boolean
parseMultipart
()
throws
Exception
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录