|
@@ -1,9 +1,12 @@
|
|
|
package com.usky.system.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.usky.common.core.exception.BusinessException;
|
|
|
import com.usky.system.domain.SysUserPerson;
|
|
|
import com.usky.system.mapper.SysUserPersonMapper;
|
|
|
import com.usky.system.service.SysUserPersonService;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
/**
|
|
@@ -17,4 +20,26 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
public class SysUserPersonServiceImpl extends AbstractCrudService<SysUserPersonMapper, SysUserPerson> implements SysUserPersonService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserPersonMapper sysUserPersonMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Integer upIsLoginNotify(Long userId, Integer isLoginNotify) {
|
|
|
+
|
|
|
+ if (isLoginNotify != 0 && isLoginNotify != 1) {
|
|
|
+ throw new BusinessException("参数设置错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<SysUserPerson> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(SysUserPerson::getUserId, userId)
|
|
|
+ .set(SysUserPerson::getIsLoginNotify, isLoginNotify);
|
|
|
+ int result = sysUserPersonMapper.update(null, wrapper);
|
|
|
+
|
|
|
+ if (result <= 0) {
|
|
|
+ log.error("用户:{},操作登录通知开关操作失败!");
|
|
|
+ throw new BusinessException("登录通知开关操作失败!请重试");
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|