package com.younike.service.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.younike.common.core.page.PageParam;
import com.younike.common.utils.text.Convert;
import com.younike.service.pojo.SysLogininfor;
import com.younike.service.service.ISysLogininforService;
import com.younike.service.mapper.SysLogininforMapper;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;

/**
 * 系统访问日志情况信息 服务层处理
 */
@Service
public class SysLogininforServiceImpl implements ISysLogininforService {

    @Resource
    private SysLogininforMapper logininforMapper;

    /**
     * 新增系统登录日志
     *
     * @param logininfor 访问日志对象
     */
    @Override
    public void insertLogininfor(SysLogininfor logininfor) {
        logininforMapper.insertLogininfor(logininfor);
    }

    /**
     * 查询系统登录日志集合
     *
     * @param logininfor 访问日志对象
     * @return 登录记录集合
     */
    @Override
    public Page<SysLogininfor> selectLogininforList(PageParam pageParam,SysLogininfor logininfor) {
        return logininforMapper.selectLogininforList(pageParam,logininfor);
    }

    /**
     * 批量删除系统登录日志
     *
     * @param ids 需要删除的数据
     * @return
     */
    @Override
    public int deleteLogininforByIds(String ids) {
        return logininforMapper.deleteLogininforByIds(Convert.toStrArray(ids));
    }

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