package com.yunfeiyun.agmp.common.web.system.service.impl;

import com.yunfeiyun.agmp.common.framework.web.service.ISysLoginLogService;
import com.yunfeiyun.agmp.common.web.system.mapper.SysLogininLogMapper;
import com.yunfeiyun.agmp.common.core.domain.model.IBaseLoginLog;
import org.springframework.stereotype.Service;

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

/**
 * 系统访问日志情况信息 服务层处理
 * 
 * @author 杨晓辉
 */
@Service
public class SysLoginLogServiceImpl implements ISysLoginLogService
{

    @Resource
    private SysLogininLogMapper sysLogininLogMapper;

    /**
     * 新增系统登录日志
     * 
     * @param loginLog 访问日志对象
     */
    @Override
    public void insertLoginLog(IBaseLoginLog loginLog)
    {
        loginLog.setLoggId(loginLog.getId());
        sysLogininLogMapper.insertLoginLog(loginLog);
    }

    /**
     * 查询系统登录日志集合
     * 
     * @param loginLog 访问日志对象
     * @return 登录记录集合
     */
    @Override
    public List<IBaseLoginLog> selectLoginLogList(IBaseLoginLog loginLog)
    {
        return sysLogininLogMapper.selectLoginLogList(loginLog);
    }

    /**
     * 批量删除系统登录日志
     * 
     * @param infoIds 需要删除的登录日志ID
     * @return 结果
     */
    @Override
    public int deleteLoginLogByIds(String[] infoIds)
    {
        return sysLogininLogMapper.deleteLoginLogByIds(infoIds);
    }

    /**
     * 清空系统登录日志
     */
    @Override
    public void cleanLoginLog()
    {
        sysLogininLogMapper.cleanLoginLog();
    }
}
