|
@@ -1,5 +1,6 @@
|
|
|
package com.jkcredit.invoice.hub.service.user;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.jkcredit.invoice.hub.constant.CommonConstant;
|
|
@@ -17,6 +18,8 @@ import com.jkcredit.invoice.hub.util.EncodeUtil;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.security.crypto.bcrypt.BCrypt;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -39,6 +42,9 @@ public class UserServiceImpl extends BaseService implements UserService {
|
|
|
@Resource
|
|
|
UserMapper userMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate redisTemplate;
|
|
|
+
|
|
|
@Override
|
|
|
public Optional<UserPo> getUserByUserName(String userName) {
|
|
|
return userMapper.getUserByUserName(userName);
|
|
@@ -124,7 +130,16 @@ public class UserServiceImpl extends BaseService implements UserService {
|
|
|
userPo.setStatus(userDto.getStatus());
|
|
|
}
|
|
|
userPo.setUpdateTime(new Date());
|
|
|
- return userMapper.updateById(userPo) == 1;
|
|
|
+ if (userMapper.updateById(userPo) == 1) {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("appSecret", userPo.getAppSecret());
|
|
|
+ jsonObject.put("userId", userPo.getId().toString());
|
|
|
+ jsonObject.put("status", userPo.getStatus().toString());
|
|
|
+ redisTemplate.opsForValue().set(CommonConstant.INVOICE_HUB_USER_APPKEY + userPo.getAppKey(), jsonObject);
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|