chore(config): 更新日志配置文件路径并添加代码风格配置

This commit is contained in:
2025-11-13 13:52:57 +08:00
parent 5ea923cda8
commit 750bd51eab
28 changed files with 5008 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
@Service
public class UserService {
@Autowired
private UserRepository userRepository;
@Cacheable(value = "users", key = "#userId")
public User getUserById(Long userId) {
return userRepository.findById(userId).orElse(null);
}
@CachePut(value = "users", key = "#user.id")
// @CachePut(value = "users", key = "#user.id + '_' + #user.age")
public User updateUser(User user) {
userRepository.save(user);
return user;
}
@CacheEvict(value = "users", key = "#userId")
public void deleteUser(Long userId) {
userRepository.deleteById(userId);
}
@CacheEvict(value = "users", allEntries = true)
public void clearCache() {
// 清空缓存
}
}