LogServiceImpl.java
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.uccc.log.service.impl;
import com.uccc.log.mapper.SystemLogMapper;
import com.uccc.log.service.LogService;
import com.uccc.pretty.common.SystemLog;
import com.uccc.pretty.common.SystemLogEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by bert on 2021-09-15 13:17
*/
@Service
public class LogServiceImpl implements LogService {
@Autowired
private SystemLogMapper systemLogMapper;
@Override
public int insertLog(SystemLog systemLog) {
return systemLogMapper.insertLog(systemLog);
}
@Override
public List<SystemLogEntity> getSysLogByCondition(Integer limit, Integer page, Long operator, String action, String ip, String[] time) {
String startTime = null;
String endTime = null;
if (time != null) {
startTime = time[0];
endTime = time[1];
}
System.out.print(startTime);
System.out.print(endTime);
return systemLogMapper.selectSysLogByCondition(limit, page, operator, action, ip, startTime, endTime);
}
@Override
public int getSysLogCountByCondition(Long operator, String action, String ip, String[] time) {
String startTime = null;
String endTime = null;
if (time != null) {
startTime = time[0];
endTime = time[1];
}
return systemLogMapper.selectSysLogCountByCondition(operator, action, ip, startTime, endTime);
}
}