1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package com.bowintek.practice.services.impl.system;
- import com.bowintek.practice.mapper.SysLogMapper;
- import com.bowintek.practice.mapper.cquery.SysLogCQuery;
- import com.bowintek.practice.model.SysLog;
- import com.bowintek.practice.services.service.system.LogService;
- import com.bowintek.practice.vo.system.LogModel;
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.util.Date;
- import java.util.List;
- import java.util.UUID;
- @Service("logService")
- public class LogServiceImpl implements LogService {
- @Autowired
- private SysLogMapper sysLogMapper;
- @Autowired
- private SysLogCQuery sysLogCQuery;
- @Override
- public PageInfo<LogModel> getList(Integer page, Integer rows, String loginID, String userName, Date startDate, Date endDate,List<String> idList){
- PageHelper.startPage(page, rows);
- List<LogModel> dataList = sysLogCQuery.selectLogList(loginID, userName, startDate,endDate,idList);
- PageInfo<LogModel> result = new PageInfo(dataList);
- return result;
- }
- public Integer save(String pageName, String pageUrl, String actionName, String userID) {
- try{
- SysLog sysLog = new SysLog();
- sysLog.setLogID(UUID.randomUUID().toString());
- sysLog.setPageName(pageName);
- sysLog.setPageUrl(pageUrl);
- sysLog.setActionName(actionName);
- sysLog.setUserID(userID);
- sysLog.setLogTime(new Date());
- sysLogMapper.insert(sysLog);
- }
- catch (Exception ex){
- }
- return 1;
- }
- }
|