🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 组件源码 /** * <b>方法描述:</b> 移除区间元素(按排序值) <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-09 11:03:04 <br/> * * @param key * 入参|key|{@link java.lang.String} * @param start * 入参|最小值|{@link java.lang.String} * @param end * 入参|最大值|{@link java.lang.String} * @param count * 出参|移除个数|{@link long} * @return -1 异常<br/> * 1 成功<br/> */ @Component(label = "移除区间元素(按排序值)", style = "判断型", type = "同步组件", comment = "移除有序集key中,所有score值介于min和max之间(包括等于min或max)的成员", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-09 11:03:04") @InParams(param = { @Param(name = "key", comment = "key", type = java.lang.String.class), @Param(name = "start", comment = "最小值", type = double.class), @Param(name = "end", comment = "最大值", type = double.class) }) @OutParams(param = { @Param(name = "count", comment = "移除个数", type = long.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) public static ResultBase P_zremrangeByScore(String key, double start, double end) { try { long obj = redisTemplate.opsForZSet().removeRangeByScore(key, start, end); return ResultBase.newSuccessResult(obj); } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTR6013", "移除区间元素(按排序值) 异常:" + AppLog.errorMsg(e)); } } 交易中组件使用方式: ![](https://img.kancloud.cn/bd/ab/bdab27dfb40344062a873b353701859f_950x750.jpg) ## 参数说明及示例 key:redis中的key,示例: `"qwer"` 最小值:移除左区间排序,示例: `2` 最大值:移除右区间排序,示例: `5` 移除个数:返回当前区间被移除的元素数量,示例: `__INNER__["num"]` > 移除有序集key中,所有score值介于min和max之间(包括等于min或max)的成员