Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
4decf579
Commit
4decf579
authored
Nov 30, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加上下架
parent
0adc8aa1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
SysLog.java
...rc/main/java/com/xxfc/platform/vehicle/entity/SysLog.java
+1
-1
LogAspect.java
...rc/main/java/com/xxfc/platform/vehicle/aop/LogAspect.java
+10
-8
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/SysLog.java
View file @
4decf579
...
...
@@ -81,7 +81,7 @@ public class SysLog implements Serializable {
@Column
(
name
=
"crt_user"
)
@ApiModelProperty
(
"用户id"
)
private
Lo
ng
crtUser
;
private
Stri
ng
crtUser
;
@Column
(
name
=
"crt_time"
)
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/aop/LogAspect.java
View file @
4decf579
...
...
@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.common.util.HttpContextUtils;
import
com.github.wxiaoqi.security.common.util.IPUtils
;
import
com.xxfc.platform.vehicle.biz.SysLogBiz
;
import
com.xxfc.platform.vehicle.entity.SysLog
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
...
...
@@ -36,13 +37,13 @@ public class LogAspect {
try
{
// 执行方法
result
=
point
.
proceed
();
// 执行时长(毫秒)
long
time
=
System
.
currentTimeMillis
()
-
beginTime
;
// 保存日志
saveLog
(
point
,
time
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
// 执行时长(毫秒)
long
time
=
System
.
currentTimeMillis
()
-
beginTime
;
// 保存日志
saveLog
(
point
,
time
);
return
result
;
}
...
...
@@ -72,10 +73,11 @@ public class LogAspect {
Integer
state
=
0
;
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
params
+=
" "
+
paramNames
[
i
]
+
": "
+
args
[
i
];
if
(
paramNames
[
i
].
contains
(
"id"
))
vehicleId
=
args
[
i
].
toString
();
if
(
paramNames
[
i
].
contains
(
"state"
))
state
=
Integer
.
parseInt
(
args
[
i
].
toString
());
if
(
paramNames
[
i
].
contains
(
"vehicle"
)){
Vehicle
vehicle
=
(
Vehicle
)
args
[
i
];
vehicleId
=
vehicle
.
getId
();
state
=
vehicle
.
getState
();
}
}
sysLog
.
setParams
(
params
);
sysLog
.
setVehicleId
(
vehicleId
);
...
...
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