Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
online-edu
online-edu-backend
Commits
bf63e70a
Commit
bf63e70a
authored
May 13, 2021
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished 日志管理
parent
66150375
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
4 deletions
+30
-4
QueryLogTypeEnum.java
src/main/java/com/qkdata/biz/enums/QueryLogTypeEnum.java
+5
-0
QueryLogModel.java
src/main/java/com/qkdata/biz/sys/vo/QueryLogModel.java
+6
-0
LocalDateTimeDeserializer.java
...om/qkdata/common/converter/LocalDateTimeDeserializer.java
+1
-1
SysLogMapper.xml
src/main/resources/mappers/sys/SysLogMapper.xml
+18
-3
No files found.
src/main/java/com/qkdata/biz/enums/QueryLogTypeEnum.java
0 → 100644
View file @
bf63e70a
package
com
.
qkdata
.
biz
.
enums
;
public
enum
QueryLogTypeEnum
{
username
,
operation
,
method
,
dayRange
}
src/main/java/com/qkdata/biz/sys/vo/QueryLogModel.java
View file @
bf63e70a
package
com
.
qkdata
.
biz
.
sys
.
vo
;
import
com.qkdata.biz.enums.QueryLogTypeEnum
;
import
com.qkdata.common.constants.Constants
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
@Data
public
class
QueryLogModel
{
private
Integer
pageIndex
=
Constants
.
DEFAULT_PAGE
;
private
Integer
pageSize
=
Constants
.
DEFAULT_PAGE_SIZE
;
private
String
condition
;
private
LocalDateTime
start
;
private
LocalDateTime
end
;
private
QueryLogTypeEnum
type
;
}
src/main/java/com/qkdata/common/converter/LocalDateTimeDeserializer.java
View file @
bf63e70a
...
...
@@ -25,7 +25,7 @@ public class LocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
return
Instant
.
ofEpochMilli
(
p
.
getLongValue
()).
atZone
(
ZoneId
.
systemDefault
()).
toLocalDateTime
();
}
catch
(
Exception
e
)
{
log
.
warn
(
"时间转换异常"
,
e
);
throw
new
BusinessException
(
"时间转换异常"
)
;
return
null
;
}
}
...
...
src/main/resources/mappers/sys/SysLogMapper.xml
View file @
bf63e70a
...
...
@@ -3,9 +3,23 @@
<mapper
namespace=
"com.qkdata.biz.sys.mapper.SysLogMapper"
>
<select
id=
"queryPageList"
resultType=
"com.qkdata.biz.sys.entity.SysLogPO"
>
select * from sys_log where 1=1
<if
test=
"p.condition != null and p.condition != ''"
>
and username like concat('%',#{p.condition},'%') or operation like concat('%',#{p.condition},'%')
</if>
<choose>
<when
test=
"p.type == @com.qkdata.biz.enums.QueryLogTypeEnum@username"
>
and username like concat('%',#{p.condition},'%')
</when>
<when
test=
"p.type == @com.qkdata.biz.enums.QueryLogTypeEnum@operation"
>
and operation like concat('%',#{p.condition},'%')
</when>
<when
test=
"p.type == @com.qkdata.biz.enums.QueryLogTypeEnum@method"
>
and method like concat('%',#{p.condition},'%')
</when>
<when
test=
"p.type == @com.qkdata.biz.enums.QueryLogTypeEnum@dayRange"
>
and create_time
>
= #{p.start} and create_time
<
= #{p.end}
</when>
<otherwise>
and username like concat('%',#{p.condition},'%')
</otherwise>
</choose>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
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