package com.hfkj.service.impl;

import com.hfkj.dao.BsDeviceOperateLogMapper;
import com.hfkj.entity.BsDeviceOperateLog;
import com.hfkj.service.BsDeviceOperateLogService;
import com.hfkj.sysenum.DeviceOpTypeEnum;
import org.springframework.stereotype.Service;

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

@Service("deviceOperateLogService")
public class BsDeviceOperateLogServiceImpl implements BsDeviceOperateLogService {

    @Resource
    private BsDeviceOperateLogMapper deviceOperateLogMapper;

    @Override
    public void insertLog(Long deviceId, DeviceOpTypeEnum deviceOpType, String content, Long opUserId, String opUserName) {
        BsDeviceOperateLog log = new BsDeviceOperateLog();
        log.setDeviceId(deviceId);
        log.setType(deviceOpType.getNumber());
        log.setContent(content);
        log.setOpUserId(opUserId);
        log.setOpUserName(opUserName);
        log.setCreateTime(new Date());
        deviceOperateLogMapper.insert(log);
    }

}
