package com.gz.service.system.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gz.mapper.system.LogMapper;
import com.gz.rvo.system.LogRVO;
import com.gz.service.system.LogService;
import com.gz.vo.system.LogVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author LiuchangLan
 * @date 2020/9/7 20:17
 */
@Service
public class LogServiceImpl implements LogService {

    @Resource
    private LogMapper logMapper;

    @Override
    public PageInfo<LogRVO> selectByPage(LogVO logVO) {
        if (logVO.getPageNum() != null && logVO.getPageSize() != null){
            PageHelper.startPage(logVO.getPageNum(),logVO.getPageSize());
        }
        return new PageInfo<>(logMapper.selectByTime(logVO));
    }

    @Override
    public List<String> selectLogModule() {
        return logMapper.selectLogModule();
    }

    @Override
    public List<String> selectLogBusiness(String module) {
        return logMapper.selectLogBusiness(module);
    }

    @Override
    public Integer clearAll() {
        return logMapper.clearAll();
    }

    @Override
    public Integer clearThirtyOut() {
        return logMapper.clearThirtyOut();
    }
}
