package com.usoft.credit.bl;

import com.usoft.credit.dal.entity.Log;
import com.usoft.credit.dal.mapper.LogMapper;
import com.usoft.credit.util.RandomCodeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liuam
 * @since 2018/8/7 0007 下午 14:31
 */
@Service
public class LogBL {

    @SuppressWarnings("SpringJavaAutowiringInspection")
    @Autowired
    private LogMapper logMapper;

    public void save(Log log) {
        log.setCode(RandomCodeUtils.timeStampCode());
        logMapper.insertSelective(log);
    }

    public void saveEnterpriseLog() {
        Log log = new Log();
        log.setLogType("enterprise");
        log.setCode(RandomCodeUtils.timeStampCode());
        logMapper.insertSelective(log);
    }

    public void savePersonLog() {
        Log log = new Log();
        log.setLogType("person");
        log.setCode(RandomCodeUtils.timeStampCode());
        logMapper.insertSelective(log);
    }

}
