修改用户缓存

This commit is contained in:
OPGame
2019-08-08 10:55:48 +08:00
parent 1f6af397ab
commit 715d7f1eb7

View File

@@ -17,6 +17,7 @@ import com.yami.shop.dao.UserMapper;
import com.yami.shop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.Date;
@@ -33,7 +34,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Override
@CacheEvict(cacheNames="user",key="#userId")
@Cacheable(cacheNames="user",key="#userId")
public User getUserByUserId(String userId) {
return userMapper.selectById(userId);
}