package com.bootdo.datas.service.impl;

import com.bootdo.common.utils.ShiroUtils;
import com.bootdo.datas.dao.ExamineLogDao;
import com.bootdo.datas.dto.ExamineLogDTO;
import com.bootdo.datas.service.ExamineLogService;
import com.bootdo.system.domain.UserDO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ExamineLogServiceImpl implements ExamineLogService {

    private static Logger log = LoggerFactory.getLogger(ExamineLogServiceImpl.class);

    @Autowired
    private ExamineLogDao examineLogDao;

    @Override
    public List<ExamineLogDTO> list(Map<String, Object> map) {
        return examineLogDao.list(map);
    }

    @Override
    public int countTotal(Map<String, Object> map) {
        return examineLogDao.countTotal(map);
    }

    @Override
    public boolean save(ExamineLogDTO dto) {
        UserDO currUser = ShiroUtils.getUser();
        dto.setUserIdCreate(currUser.getUserId());
        return examineLogDao.save(dto);
    }
}
