Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
01b796a5
Commit
01b796a5
authored
Apr 07, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志详情的展示
parent
75cb219b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
9 deletions
+31
-9
src/main/java/com/stylefeng/guns/modular/system/controller/LogController.java
+4
-1
src/main/java/com/stylefeng/guns/modular/system/warpper/LogWarpper.java
+14
-6
src/main/webapp/static/js/common/Feng.js
+12
-1
src/main/webapp/static/modular/system/log/log.js
+1
-1
No files found.
src/main/java/com/stylefeng/guns/modular/system/controller/LogController.java
View file @
01b796a5
...
@@ -3,6 +3,7 @@ package com.stylefeng.guns.modular.system.controller;
...
@@ -3,6 +3,7 @@ package com.stylefeng.guns.modular.system.controller;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.stylefeng.guns.common.constant.factory.PageFactory
;
import
com.stylefeng.guns.common.constant.factory.PageFactory
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.core.support.BeanKit
;
import
com.stylefeng.guns.modular.system.warpper.LogWarpper
;
import
com.stylefeng.guns.modular.system.warpper.LogWarpper
;
import
com.stylefeng.guns.persistence.dao.OperationLogMapper
;
import
com.stylefeng.guns.persistence.dao.OperationLogMapper
;
import
com.stylefeng.guns.persistence.model.OperationLog
;
import
com.stylefeng.guns.persistence.model.OperationLog
;
...
@@ -56,6 +57,8 @@ public class LogController extends BaseController {
...
@@ -56,6 +57,8 @@ public class LogController extends BaseController {
@RequestMapping
(
"/detail/{id}"
)
@RequestMapping
(
"/detail/{id}"
)
@ResponseBody
@ResponseBody
public
Object
detail
(
@PathVariable
Integer
id
){
public
Object
detail
(
@PathVariable
Integer
id
){
return
operationLogMapper
.
selectById
(
id
);
OperationLog
operationLog
=
operationLogMapper
.
selectById
(
id
);
Map
<
String
,
Object
>
stringObjectMap
=
BeanKit
.
beanToMap
(
operationLog
);
return
super
.
warpObject
(
new
LogWarpper
(
stringObjectMap
));
}
}
}
}
src/main/java/com/stylefeng/guns/modular/system/warpper/LogWarpper.java
View file @
01b796a5
package
com
.
stylefeng
.
guns
.
modular
.
system
.
warpper
;
package
com
.
stylefeng
.
guns
.
modular
.
system
.
warpper
;
import
com.stylefeng.guns.common.warpper.BaseControllerWarpper
;
import
com.stylefeng.guns.common.warpper.BaseControllerWarpper
;
import
com.stylefeng.guns.core.util.Contrast
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -14,18 +14,26 @@ import java.util.Map;
...
@@ -14,18 +14,26 @@ import java.util.Map;
*/
*/
public
class
LogWarpper
extends
BaseControllerWarpper
{
public
class
LogWarpper
extends
BaseControllerWarpper
{
public
LogWarpper
(
List
<
Map
<
String
,
Object
>>
list
)
{
public
LogWarpper
(
Object
list
)
{
super
(
list
);
super
(
list
);
}
}
@Override
@Override
public
void
warpTheMap
(
Map
<
String
,
Object
>
map
)
{
public
void
warpTheMap
(
Map
<
String
,
Object
>
map
)
{
String
message
=
(
String
)
map
.
get
(
"message"
);
String
message
=
(
String
)
map
.
get
(
"message"
);
//如果信息过长,则只截取前100位字符串
if
(
ToolUtil
.
isNotEmpty
(
message
)
&&
message
.
length
()
>=
100
)
{
if
(
ToolUtil
.
isNotEmpty
(
message
)
&&
message
.
length
()
>=
100
)
{
message
=
message
.
substring
(
0
,
100
)
+
"..."
;
String
subMessage
=
message
.
substring
(
0
,
100
)
+
"..."
;
map
.
put
(
"message"
,
message
);
map
.
put
(
"message"
,
subMessage
);
}
else
{
}
return
;
//如果信息中包含分割符号;;; 则分割字符串返给前台
if
(
message
.
indexOf
(
Contrast
.
separator
)
!=
-
1
)
{
String
[]
msgs
=
message
.
split
(
Contrast
.
separator
);
map
.
put
(
"regularMessage"
,
msgs
);
}
else
{
map
.
put
(
"regularMessage"
,
message
);
}
}
}
}
...
...
src/main/webapp/static/js/common/Feng.js
View file @
01b796a5
...
@@ -23,12 +23,23 @@ var Feng = {
...
@@ -23,12 +23,23 @@ var Feng = {
Feng
.
alert
(
info
,
2
);
Feng
.
alert
(
info
,
2
);
},
},
infoDetail
:
function
(
title
,
info
)
{
infoDetail
:
function
(
title
,
info
)
{
var
display
=
""
;
if
(
typeof
info
==
"string"
)
{
display
=
info
;
}
else
{
if
(
info
instanceof
Array
)
{
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
display
=
display
+
info
[
i
]
+
"<br/>"
;
}
}
}
var
index
=
parent
.
layer
.
open
({
var
index
=
parent
.
layer
.
open
({
title
:
title
,
title
:
title
,
type
:
1
,
type
:
1
,
skin
:
'layui-layer-rim'
,
//加上边框
skin
:
'layui-layer-rim'
,
//加上边框
area
:
[
'950px'
,
'600px'
],
//宽高
area
:
[
'950px'
,
'600px'
],
//宽高
content
:
'<div style="padding: 20px;">'
+
info
+
'</div>'
content
:
'<div style="padding: 20px;">'
+
display
+
'</div>'
});
});
},
},
writeObj
:
function
(
obj
)
{
writeObj
:
function
(
obj
)
{
...
...
src/main/webapp/static/modular/system/log/log.js
View file @
01b796a5
...
@@ -51,7 +51,7 @@ OptLog.check = function () {
...
@@ -51,7 +51,7 @@ OptLog.check = function () {
OptLog
.
detail
=
function
()
{
OptLog
.
detail
=
function
()
{
if
(
this
.
check
())
{
if
(
this
.
check
())
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/log/detail/"
+
this
.
seItem
.
id
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/log/detail/"
+
this
.
seItem
.
id
,
function
(
data
)
{
Feng
.
infoDetail
(
"日志详情"
,
data
.
m
essage
);
Feng
.
infoDetail
(
"日志详情"
,
data
.
regularM
essage
);
},
function
(
data
)
{
},
function
(
data
)
{
Feng
.
error
(
"获取详情失败!"
);
Feng
.
error
(
"获取详情失败!"
);
});
});
...
...
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