Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
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
姚本章
dm_project
Commits
77e8de6b
Commit
77e8de6b
authored
Jan 25, 2021
by
zhangc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分代码
parent
30c66f80
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
64 deletions
+78
-64
OrganizationManageImpl.java
...n/java/com/jz/dm/service/impl/OrganizationManageImpl.java
+1
-1
ApiQueryService.java
.../main/java/com/jz/dm/service/request/ApiQueryService.java
+43
-33
SystemLogAspect.java
...y/src/main/java/com/jz/dm/web/aspect/SystemLogAspect.java
+34
-30
No files found.
jz-dm-apigateway/src/main/java/com/jz/dm/service/impl/OrganizationManageImpl.java
View file @
77e8de6b
...
@@ -223,7 +223,7 @@ public class OrganizationManageImpl implements OrganizationManageService {
...
@@ -223,7 +223,7 @@ public class OrganizationManageImpl implements OrganizationManageService {
public
ApiOrg
getAuthOrganization
(
Long
apiOrgId
)
{
public
ApiOrg
getAuthOrganization
(
Long
apiOrgId
)
{
QueryWrapper
<
ApiOrg
>
query
=
new
QueryWrapper
<>();
QueryWrapper
<
ApiOrg
>
query
=
new
QueryWrapper
<>();
query
.
eq
(
"id"
,
apiOrgId
);
query
.
eq
(
"id"
,
apiOrgId
);
query
.
eq
(
"status"
,
OrgStatusEnum
.
NORMAL
.
name
()
);
query
.
eq
(
"status"
,
1
);
query
.
eq
(
"is_deleted"
,
0
);
query
.
eq
(
"is_deleted"
,
0
);
return
apiOrgMapper
.
selectOne
(
query
);
return
apiOrgMapper
.
selectOne
(
query
);
}
}
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/service/request/ApiQueryService.java
View file @
77e8de6b
...
@@ -87,19 +87,21 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -87,19 +87,21 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
@ApiLogAspect
(
description
=
"API请求日志"
)
@ApiLogAspect
(
description
=
"API请求日志"
)
@AccessLimit
(
limit
=
10000
,
sec
=
1
)
@AccessLimit
(
limit
=
10000
,
sec
=
1
)
@SentinelResource
(
value
=
"api.gateway"
,
fallback
=
"fallbackGateway"
)
@SentinelResource
(
value
=
"api.gateway"
,
fallback
=
"fallbackGateway"
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRE
S_NEW
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRE
D
)
public
void
doService
(
OpenApiRequest
request
,
OpenApiResponse
response
)
{
public
void
doService
(
OpenApiRequest
request
,
OpenApiResponse
response
)
{
boolean
bResult
=
false
;
boolean
bResult
=
false
;
JSONObject
parameter
=
JSONObject
.
parseObject
(
request
.
getOpenApiParams
());
JSONObject
parameter
=
JSONObject
.
parseObject
(
request
.
getOpenApiParams
());
ApiInterface
apiInterface
=
apiInterfaceService
.
getApiInfo
(
request
.
getApiKey
());
ApiInterface
apiInterface
=
apiInterfaceService
.
getApiInfo
(
request
.
getApiKey
());
ApiAuth
apiAuth
=
null
;
ApiAuth
apiAuth
=
null
;
JSONObject
jsonParams
=
null
;
try
{
try
{
Boolean
isTest
=
parameter
.
getBoolean
(
"isTest"
);
Boolean
isTest
=
parameter
.
getBoolean
(
"isTest"
);
String
reqParams
=
parameter
.
getString
(
"reqParams"
);
String
reqParams
=
parameter
.
getString
(
"reqParams"
);
parameter
.
put
(
"is_test"
,
isTest
);
Map
paramMap
=
null
;
Map
paramMap
=
null
;
if
(
StringUtils
.
isNotBlank
(
reqParams
))
{
if
(
StringUtils
.
isNotBlank
(
reqParams
))
{
paramMap
=
(
Map
)
JSONObject
.
parseObject
(
reqParams
);
jsonParams
=
JSONObject
.
parseObject
(
reqParams
);
paramMap
.
put
(
"is_test"
,
isTest
);
paramMap
=
JSONObject
.
parseObject
(
jsonParams
.
getString
(
"request_fileds"
),
Map
.
class
);
}
}
if
(!
isTest
)
{
//如果不是测试
if
(!
isTest
)
{
//如果不是测试
String
authCode
=
parameter
.
getString
(
"authCode"
);
String
authCode
=
parameter
.
getString
(
"authCode"
);
...
@@ -110,17 +112,19 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -110,17 +112,19 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
apiAuth
=
authService
.
getAuthInfo
(
authCode
);
apiAuth
=
authService
.
getAuthInfo
(
authCode
);
verifyAuth
(
apiAuth
);
verifyAuth
(
apiAuth
);
//取出缓存数据
//取出缓存数据
String
redisReqParam
=
redisUtils
.
get
(
request
.
getApiKey
());
/* String redisReqParam = redisUtils.get(request.getApiKey());*/
String
redisReqParam
=
null
;
if
(
StringUtils
.
isNotBlank
(
redisReqParam
))
{
//redis中存在
if
(
StringUtils
.
isNotBlank
(
redisReqParam
))
{
//redis中存在
//解析出API制作成功时的参数配置
//解析出API制作成功时的参数配置
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
redisReqParam
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
redisReqParam
);
String
targetUrl
=
jsonObject
.
getString
(
"targetUrl"
);
String
targetUrl
=
jsonObject
.
getString
(
"targetUrl"
);
String
outputType
=
jsonObject
.
getString
(
"outputType"
);
String
outputType
=
jsonObject
.
getString
(
"outputType"
);
String
joinType
=
jsonObject
.
getString
(
"joinType"
);
String
joinType
=
jsonObject
.
getString
(
"joinType"
);
bResult
=
rangRequestTarget
(
outputType
,
targetUrl
,
false
,
paramMap
,
joinType
,
apiInterface
,
response
);
bResult
=
rangRequestTarget
(
outputType
,
targetUrl
,
false
,
paramMap
,
jsonParams
,
joinType
,
apiInterface
,
response
);
}
else
{
//不存在查询数据库
}
else
{
//不存在查询数据库
bResult
=
rangRequestTarget
(
apiInterface
.
getOutputType
(),
bResult
=
rangRequestTarget
(
apiInterface
.
getOutputType
(),
apiInterface
.
getTargetUrl
(),
false
,
paramMap
,
apiInterface
.
getJoinType
(),
apiInterface
,
response
);
apiInterface
.
getTargetUrl
(),
false
,
paramMap
,
jsonParams
,
apiInterface
.
getJoinType
(),
apiInterface
,
response
);
}
}
//调用成功请求数据银行扣款
//调用成功请求数据银行扣款
if
(
AuthModeEnum
.
POWER_CALL_MODE
.
name
().
equals
(
apiAuth
.
getAuthMode
()))
{
if
(
AuthModeEnum
.
POWER_CALL_MODE
.
name
().
equals
(
apiAuth
.
getAuthMode
()))
{
...
@@ -130,7 +134,7 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -130,7 +134,7 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
}
}
}
else
{
}
else
{
bResult
=
rangRequestTarget
(
ApiInfoOutTypeEnum
.
JSON
.
name
(),
apiInterface
.
getTargetUrl
(),
bResult
=
rangRequestTarget
(
ApiInfoOutTypeEnum
.
JSON
.
name
(),
apiInterface
.
getTargetUrl
(),
true
,
paramMap
,
apiInterface
.
getJoinType
(),
apiInterface
,
response
);
true
,
paramMap
,
jsonParams
,
apiInterface
.
getJoinType
(),
apiInterface
,
response
);
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
if
(
ex
instanceof
GatewayException
)
{
if
(
ex
instanceof
GatewayException
)
{
...
@@ -154,12 +158,12 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -154,12 +158,12 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
* @param outputType
* @param outputType
* @param targetUrl
* @param targetUrl
* @param param
* @param param
* @param isTest 是否是测试
* @param isTest
是否是测试
* @param joinType
* @param joinType
* @param response
* @param response
*/
*/
private
boolean
rangRequestTarget
(
String
outputType
,
String
targetUrl
,
Boolean
isTest
,
private
boolean
rangRequestTarget
(
String
outputType
,
String
targetUrl
,
Boolean
isTest
,
Map
<
String
,
String
>
param
,
String
joinType
,
Map
<
String
,
String
>
param
,
JSONObject
jsonParams
,
String
joinType
,
ApiInterface
apiInterface
,
OpenApiResponse
response
)
{
ApiInterface
apiInterface
,
OpenApiResponse
response
)
{
if
(
StringUtils
.
isBlank
(
outputType
))
{
if
(
StringUtils
.
isBlank
(
outputType
))
{
outputType
=
ApiInfoOutTypeEnum
.
JSON
.
name
();
outputType
=
ApiInfoOutTypeEnum
.
JSON
.
name
();
...
@@ -170,9 +174,9 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -170,9 +174,9 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
if
(
StringUtils
.
isBlank
(
joinType
))
{
if
(
StringUtils
.
isBlank
(
joinType
))
{
throw
new
GatewayException
(
GatewayResultCode
.
API_TYPE_ERROR
);
throw
new
GatewayException
(
GatewayResultCode
.
API_TYPE_ERROR
);
}
}
if
(!
isTest
){
if
(!
isTest
)
{
if
(
"10002"
.
equals
(
joinType
)
||
"10009"
.
equals
(
joinType
))
{
//数据表查询
if
(
"10002"
.
equals
(
joinType
)
||
"10009"
.
equals
(
joinType
))
{
//数据表查询
return
dataTableSelect
(
outputType
,
targetUrl
,
param
,
apiInterface
,
response
);
return
dataTableSelect
(
outputType
,
targetUrl
,
param
,
jsonParams
,
apiInterface
,
response
);
}
else
if
(
"10004"
.
equals
(
joinType
)
||
"10008"
.
equals
(
joinType
))
{
//三方查询
}
else
if
(
"10004"
.
equals
(
joinType
)
||
"10008"
.
equals
(
joinType
))
{
//三方查询
return
thirdSelect
(
targetUrl
,
apiInterface
,
response
);
return
thirdSelect
(
targetUrl
,
apiInterface
,
response
);
}
else
if
(
"10005"
.
equals
(
joinType
)
||
"10007"
.
equals
(
joinType
))
{
//数据包查询
}
else
if
(
"10005"
.
equals
(
joinType
)
||
"10007"
.
equals
(
joinType
))
{
//数据包查询
...
@@ -180,8 +184,8 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -180,8 +184,8 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
}
else
{
}
else
{
throw
new
GatewayException
(
GatewayResultCode
.
API_TYPE_ERROR
);
throw
new
GatewayException
(
GatewayResultCode
.
API_TYPE_ERROR
);
}
}
}
else
{
}
else
{
return
dataTableSelect
(
outputType
,
targetUrl
,
param
,
apiInterface
,
response
);
return
dataTableSelect
(
outputType
,
targetUrl
,
param
,
jsonParams
,
apiInterface
,
response
);
}
}
}
}
...
@@ -232,12 +236,12 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -232,12 +236,12 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
* @param response
* @param response
* @return
* @return
*/
*/
private
boolean
dataTableSelect
(
String
outputType
,
String
targetUrl
,
Map
<
String
,
String
>
param
,
ApiInterface
apiInterface
,
OpenApiResponse
response
)
{
private
boolean
dataTableSelect
(
String
outputType
,
String
targetUrl
,
Map
<
String
,
String
>
param
,
JSONObject
jsonParams
,
ApiInterface
apiInterface
,
OpenApiResponse
response
)
{
ApiInterfaceCustom
apiCustomInfo
=
checkParamLegal
(
param
,
apiInterface
);
ApiInterfaceCustom
apiCustomInfo
=
checkParamLegal
(
param
,
apiInterface
);
if
(
ApiInfoOutTypeEnum
.
FLOW
.
name
().
equals
(
outputType
))
{
//文件流形式请求
if
(
ApiInfoOutTypeEnum
.
FLOW
.
name
().
equals
(
outputType
))
{
//文件流形式请求
return
flowRequestMethod
(
targetUrl
,
param
,
response
,
apiCustomInfo
);
return
flowRequestMethod
(
targetUrl
,
param
,
response
,
apiCustomInfo
);
}
else
if
(
ApiInfoOutTypeEnum
.
JSON
.
name
().
equals
(
outputType
))
{
//json格式请求
}
else
if
(
ApiInfoOutTypeEnum
.
JSON
.
name
().
equals
(
outputType
))
{
//json格式请求
return
jsonRequestMethod
(
targetUrl
,
param
,
response
,
apiCustomInfo
);
return
jsonRequestMethod
(
targetUrl
,
param
,
jsonParams
,
response
,
apiCustomInfo
);
}
else
{
}
else
{
throw
new
GatewayException
(
GatewayResultCode
.
OUTPUT_TYPE_EXCEPTION
);
throw
new
GatewayException
(
GatewayResultCode
.
OUTPUT_TYPE_EXCEPTION
);
}
}
...
@@ -259,7 +263,8 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -259,7 +263,8 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
for
(
Map
map
:
mapList
)
{
for
(
Map
map
:
mapList
)
{
if
((
Boolean
)
map
.
get
(
"required"
))
{
if
((
Boolean
)
map
.
get
(
"required"
))
{
String
name
=
(
String
)
map
.
get
(
"name"
);
String
name
=
(
String
)
map
.
get
(
"name"
);
if
(
null
==
param
.
get
(
name
))
{
String
field
=
param
.
get
(
name
);
if
(
null
==
field
)
{
tag
=
true
;
tag
=
true
;
}
}
}
}
...
@@ -316,24 +321,29 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
...
@@ -316,24 +321,29 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
* @param apiCustomInfo
* @param apiCustomInfo
* @return
* @return
*/
*/
private
boolean
jsonRequestMethod
(
String
targetUrl
,
Map
<
String
,
String
>
param
,
private
boolean
jsonRequestMethod
(
String
targetUrl
,
Map
<
String
,
String
>
param
,
JSONObject
jsonParams
,
OpenApiResponse
response
,
ApiInterfaceCustom
apiCustomInfo
)
{
OpenApiResponse
response
,
ApiInterfaceCustom
apiCustomInfo
)
{
JSONObject
params
=
new
JSONObject
();
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"datasourceId"
,
apiCustomInfo
.
getEsDataSource
());
//数据源id
try
{
params
.
put
(
"query_database"
,
apiCustomInfo
.
getEsDataBase
());
//数据源库名称
params
.
put
(
"datasourceId"
,
apiCustomInfo
.
getEsDataSource
());
//数据源id
params
.
put
(
"query_table"
,
apiCustomInfo
.
getEsTable
());
//数据源库表
params
.
put
(
"query_database"
,
apiCustomInfo
.
getEsDataBase
());
//数据源库名称
net
.
sf
.
json
.
JSONObject
reqParams
=
net
.
sf
.
json
.
JSONObject
.
fromObject
(
param
);
params
.
put
(
"query_table"
,
apiCustomInfo
.
getEsTable
());
//数据源库表
params
.
put
(
"request_fileds"
,
reqParams
);
//请求参数
net
.
sf
.
json
.
JSONObject
reqParams
=
net
.
sf
.
json
.
JSONObject
.
fromObject
(
param
);
params
.
put
(
"response_fields"
,
assembleResponseParams
(
apiCustomInfo
.
getResponseParam
()));
//响应参数
params
.
put
(
"request_fileds"
,
reqParams
);
//请求参数
Integer
pageNum
=
Integer
.
valueOf
(
param
.
get
(
"pageNum"
));
params
.
put
(
"response_fields"
,
assembleResponseParams
(
apiCustomInfo
.
getResponseParam
()));
//响应参数
Integer
pageSize
=
Integer
.
valueOf
(
param
.
get
(
"pageSize"
));
Integer
pageNum
=
jsonParams
.
getInteger
(
"page_num"
);
params
.
put
(
"page_size"
,
apiCustomInfo
.
getPageSize
());
Integer
pageSize
=
jsonParams
.
getInteger
(
"page_size"
);
params
.
put
(
"page_num"
,
apiCustomInfo
.
getPageNum
());
params
.
put
(
"page_size"
,
apiCustomInfo
.
getPageSize
());
if
(
null
!=
pageNum
)
{
params
.
put
(
"page_num"
,
apiCustomInfo
.
getPageNum
());
params
.
put
(
"page_num"
,
pageNum
);
if
(
null
!=
pageNum
)
{
}
params
.
put
(
"page_num"
,
pageNum
);
if
(
null
!=
pageSize
)
{
}
params
.
put
(
"page_size"
,
pageSize
);
if
(
null
!=
pageSize
)
{
params
.
put
(
"page_size"
,
pageSize
);
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"数据转换异常:{}"
,
ex
.
getMessage
());
ex
.
printStackTrace
();
}
}
String
respResult
=
httpsUtils
.
submitPost
(
targetUrl
,
params
.
toString
());
String
respResult
=
httpsUtils
.
submitPost
(
targetUrl
,
params
.
toString
());
return
callMethodResponse
(
respResult
,
response
);
return
callMethodResponse
(
respResult
,
response
);
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/web/aspect/SystemLogAspect.java
View file @
77e8de6b
...
@@ -69,7 +69,6 @@ public class SystemLogAspect {
...
@@ -69,7 +69,6 @@ public class SystemLogAspect {
}
}
@Around
(
"aroundAspect()"
)
@Around
(
"aroundAspect()"
)
public
void
doAround
(
ProceedingJoinPoint
joinPoint
)
{
public
void
doAround
(
ProceedingJoinPoint
joinPoint
)
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
...
@@ -81,8 +80,9 @@ public class SystemLogAspect {
...
@@ -81,8 +80,9 @@ public class SystemLogAspect {
params
+=
JsonUtils
.
objectToJson
(
joinPoint
.
getArgs
()[
i
])
+
";"
;
params
+=
JsonUtils
.
objectToJson
(
joinPoint
.
getArgs
()[
i
])
+
";"
;
}
}
}
}
if
(
StringUtils
.
isNotBlank
(
params
)){
if
(
StringUtils
.
isNotBlank
(
params
))
{
params
=
params
.
substring
(
0
,
params
.
length
()-
1
).
split
(
";"
)[
0
];;
params
=
params
.
substring
(
0
,
params
.
length
()
-
1
).
split
(
";"
)[
0
];
;
}
}
//获取请求路径
//获取请求路径
String
url
=
UrlUtil
.
getServerUrl
(
request
);
String
url
=
UrlUtil
.
getServerUrl
(
request
);
...
@@ -95,33 +95,37 @@ public class SystemLogAspect {
...
@@ -95,33 +95,37 @@ public class SystemLogAspect {
String
paramsList
=
jsonObject
.
getString
(
"openApiParams"
);
String
paramsList
=
jsonObject
.
getString
(
"openApiParams"
);
com
.
alibaba
.
fastjson
.
JSONObject
jsonParamsList
=
com
.
alibaba
.
fastjson
.
JSONObject
.
parseObject
(
paramsList
);
com
.
alibaba
.
fastjson
.
JSONObject
jsonParamsList
=
com
.
alibaba
.
fastjson
.
JSONObject
.
parseObject
(
paramsList
);
ApiReqLog
reqLog
=
new
ApiReqLog
();
ApiReqLog
reqLog
=
new
ApiReqLog
();
JSONObject
jsonResult
=
null
;
JSONObject
jsonResult
=
null
;
try
{
Boolean
isTest
=
jsonParamsList
.
getBoolean
(
"isTest"
);
reqLog
.
setRequestIp
(
ip
);
//不保存测试数据
reqLog
.
setApiKey
(
jsonObject
.
getString
(
"apiKey"
));
if
(!
isTest
)
{
reqLog
.
setRequestParams
(
params
);
try
{
reqLog
.
setResponseParams
(
""
);
//响应参数
reqLog
.
setRequestIp
(
ip
);
reqLog
.
setRequestUrl
(
url
);
reqLog
.
setApiKey
(
jsonObject
.
getString
(
"apiKey"
));
reqLog
.
setRequestMethod
(
contextPath
);
reqLog
.
setRequestParams
(
params
);
reqLog
.
setEncryMode
(
jsonObject
.
getString
(
"signType"
));
//加密方式:MD5,RSA
reqLog
.
setResponseParams
(
""
);
//响应参数
reqLog
.
setEncryMode
(
"MD5"
);
//加密方式暂时写死MD5
reqLog
.
setRequestUrl
(
url
);
reqLog
.
setTransMode
(
request
.
getMethod
());
//传输方式 GET POST
reqLog
.
setRequestMethod
(
contextPath
);
reqLog
.
setRequestToken
(
jsonParamsList
.
getString
(
"authCode"
));
reqLog
.
setEncryMode
(
jsonObject
.
getString
(
"signType"
));
//加密方式:MD5,RSA
reqLog
.
setRequestStartTime
(
new
Date
());
//reqLog.setEncryMode("MD5"); //加密方式暂时写死MD5
reqLog
.
setRemark
(
getServiceMethodDescription
(
joinPoint
));
reqLog
.
setTransMode
(
request
.
getMethod
());
//传输方式 GET POST
log
.
info
(
"请求参数:"
,
reqLog
);
reqLog
.
setRequestToken
(
jsonParamsList
.
getString
(
"authCode"
));
if
(
null
!=
reqLog
)
{
reqLog
.
setRequestStartTime
(
new
Date
());
apiReqLogMapper
.
insert
(
reqLog
);
reqLog
.
setRemark
(
getServiceMethodDescription
(
joinPoint
));
log
.
info
(
"请求参数:"
,
reqLog
);
if
(
null
!=
reqLog
)
{
apiReqLogMapper
.
insert
(
reqLog
);
}
Object
result
=
joinPoint
.
proceed
(
joinPoint
.
getArgs
());
jsonResult
=
JSONObject
.
fromObject
(
result
);
log
.
info
(
"around响应结果为{}"
,
jsonResult
);
apiLogService
.
updateLog
(
reqLog
.
getId
(),
jsonResult
);
}
catch
(
GatewayException
ex
)
{
log
.
info
(
"切面处理保存异常信息:{}"
,
ex
.
getMessage
());
apiLogService
.
updateLog
(
reqLog
.
getId
(),
jsonResult
);
}
catch
(
Throwable
throwable
)
{
throwable
.
printStackTrace
();
}
}
Object
result
=
joinPoint
.
proceed
(
joinPoint
.
getArgs
());
jsonResult
=
JSONObject
.
fromObject
(
result
);
log
.
info
(
"around响应结果为{}"
,
jsonResult
);
apiLogService
.
updateLog
(
reqLog
.
getId
(),
jsonResult
);
}
catch
(
GatewayException
ex
)
{
log
.
info
(
"切面处理保存异常信息:{}"
,
ex
.
getMessage
());
apiLogService
.
updateLog
(
reqLog
.
getId
(),
jsonResult
);
}
catch
(
Throwable
throwable
){
throwable
.
printStackTrace
();
}
}
}
}
/*@Before("beforeAspect()")
/*@Before("beforeAspect()")
...
@@ -204,7 +208,7 @@ public class SystemLogAspect {
...
@@ -204,7 +208,7 @@ public class SystemLogAspect {
// log.error("异常信息{}", e.getMessage());
// log.error("异常信息{}", e.getMessage());
// }
// }
// }
// }
/**
/**
* 获取注解中对方法的描述信息 用于service层注解
* 获取注解中对方法的描述信息 用于service层注解
...
...
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