优化代码

This commit is contained in:
RuoYi
2022-08-22 15:27:58 +08:00
parent 4d71cfa90a
commit 99d1760b98
3 changed files with 5 additions and 27 deletions

View File

@ -131,7 +131,7 @@ public class SysDictData extends BaseEntity
public boolean getDefault()
{
return UserConstants.YES.equals(this.isDefault) ? true : false;
return UserConstants.YES.equals(this.isDefault);
}
public String getIsDefault()

View File

@ -124,9 +124,9 @@ public class RedisCache
* @param collection 多个对象
* @return
*/
public long deleteObject(final Collection collection)
public boolean deleteObject(final Collection collection)
{
return redisTemplate.delete(collection);
return redisTemplate.delete(collection) > 0;
}
/**
@ -231,18 +231,6 @@ public class RedisCache
return opsForHash.get(key, hKey);
}
/**
* 删除Hash中的数据
*
* @param key
* @param hKey
*/
public void delCacheMapValue(final String key, final String hKey)
{
HashOperations hashOperations = redisTemplate.opsForHash();
hashOperations.delete(key, hKey);
}
/**
* 获取多个Hash中的数据
*
@ -264,7 +252,7 @@ public class RedisCache
*/
public boolean deleteCacheMapValue(final String key, final String hKey)
{
return Boolean.TRUE.equals(redisTemplate.opsForHash().delete(key, hKey));
return redisTemplate.opsForHash().delete(key, hKey) > 0;
}
/**