| package com.zy.asrs.wcs.system.service.impl; | 
|   | 
| import com.zy.asrs.common.utils.IpTools; | 
| import com.zy.asrs.wcs.system.mapper.UserLoginMapper; | 
| import com.zy.asrs.wcs.system.entity.UserLogin; | 
| import com.zy.asrs.wcs.system.service.UserLoginService; | 
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
| import org.springframework.scheduling.annotation.Async; | 
| import org.springframework.stereotype.Service; | 
|   | 
| import javax.servlet.http.HttpServletRequest; | 
|   | 
| @Service("userLoginService") | 
| public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin> implements UserLoginService { | 
|   | 
|     @Async | 
|     @Override | 
|     public void saveAsync(Long userId, String token, Integer type, Long hostId, String memo, HttpServletRequest request) { | 
|         if (userId == null) { | 
|             return; | 
|         } | 
|         UserLogin userLogin = new UserLogin(); | 
|         userLogin.setUserId(userId); | 
|         userLogin.setToken(token); | 
|         userLogin.setType(type); | 
|         userLogin.setIp(IpTools.gainRealIp(request)); | 
|         userLogin.setMemo(memo); | 
|         baseMapper.insert(userLogin); | 
|     } | 
|   | 
| } |