package com.xindazhou.user.service.logger;

import com.xindazhou.framework.common.util.object.BeanUtils;
import com.xindazhou.framework.common.biz.infra.logger.dto.LoginLogCreateReqDTO;
import com.xindazhou.user.dal.dataobject.logger.LoginLogDO;
import com.xindazhou.user.dal.mysql.logger.LoginLogMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import jakarta.annotation.Resource;

/**
 * 登录日志 Service 实现
 */
@Service
@Validated
public class LoginLogServiceImpl implements LoginLogService {

    @Resource
    private LoginLogMapper loginLogMapper;

    @Override
    public void createLoginLog(LoginLogCreateReqDTO reqDTO) {
        LoginLogDO loginLog = BeanUtils.toBean(reqDTO, LoginLogDO.class);
        loginLogMapper.insert(loginLog);
    }

}

