|
@@ -1,17 +1,13 @@
|
|
|
package com.zanxiang.sdk.service.Impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.zanxiang.common.enums.DeviceTypeEnum;
|
|
|
-import com.zanxiang.mybatis.entity.GameUserRole;
|
|
|
import com.zanxiang.mybatis.entity.User;
|
|
|
import com.zanxiang.mybatis.entity.UserLoginLog;
|
|
|
import com.zanxiang.mybatis.mapper.UserLoginLogMapper;
|
|
|
import com.zanxiang.sdk.domain.params.UserData;
|
|
|
-import com.zanxiang.sdk.service.GameUserRoleService;
|
|
|
import com.zanxiang.sdk.service.UserLoginLogService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
@@ -25,9 +21,6 @@ import java.time.LocalDateTime;
|
|
|
@Service
|
|
|
public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, UserLoginLog> implements UserLoginLogService {
|
|
|
|
|
|
- @Autowired
|
|
|
- private GameUserRoleService gameUserRoleService;
|
|
|
-
|
|
|
/**
|
|
|
* 创建角色登录日志
|
|
|
*
|
|
@@ -37,17 +30,13 @@ public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, Use
|
|
|
* @return {@link Boolean}
|
|
|
*/
|
|
|
@Override
|
|
|
- public Boolean createRoleLoginLog(UserData userData, String roleId, Integer type) {
|
|
|
- //查询玩家角色信息
|
|
|
- GameUserRole userRole = gameUserRoleService.getOne(new LambdaQueryWrapper<GameUserRole>()
|
|
|
- .eq(GameUserRole::getGameId, userData.getGameId())
|
|
|
- .eq(GameUserRole::getRoleId, roleId));
|
|
|
+ public Boolean createRoleLoginLog(UserData userData, String roleId, String roleName, Integer type) {
|
|
|
//创建对象
|
|
|
return super.save(UserLoginLog.builder()
|
|
|
.userId(userData.getUserId())
|
|
|
.gameId(userData.getGameId())
|
|
|
- .roleId(userRole == null ? null : userRole.getRoleId())
|
|
|
- .roleName(userRole == null ? null : userRole.getRoleName())
|
|
|
+ .roleId(roleId)
|
|
|
+ .roleName(roleName)
|
|
|
.os(userData.getDeviceSystem())
|
|
|
.ip(userData.getIp())
|
|
|
.deviceType(DeviceTypeEnum.DEVICE_TYPE_ANDROID.getDeviceType())
|