🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 组件源码 /** * <b>方法描述:</b> 移除集合元素 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2020-06-10 17:36:30 <br/> * * @param key * 入参|key|{@link java.lang.String} * @param list * 入参|value列表|{@link java.util.List} * @param length * 出参|移除数量|{@link long} * @return -1 异常<br/> * 1 成功<br/> */ @Component(label = "移除集合元素", style = "判断型", type = "同步组件", comment = "在key集合中移除指定的元素.值", version = "1.0.0", deprecated = false, author = "admin", date = "2020-06-10 05:36:30") @InParams(param = { @Param(name = "key", comment = "key", type = java.lang.String.class), @Param(name = "list", comment = "value列表", type = java.util.List.class) }) @OutParams(param = { @Param(name = "length", comment = "移除数量", type = long.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) public static ResultBase P_zrem(String key, List list) { try { long obj = redisTemplate.opsForZSet().remove(key, list.toArray()); return ResultBase.newSuccessResult(obj); } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTR6005", "移除集合元素 异常:" + AppLog.errorMsg(e)); } } 交易中组件使用方式: ![](https://img.kancloud.cn/e4/43/e443aad4e8c2ba63b5c10241d5863ea5_950x750.jpg) ## 参数说明及示例 key:redis中的key,示例: `"qwer"` value列表:移除的元素列表,示例: `["q","a","w","r"]` 移除数量:返回移除的数量,示例: `__INNER__["length"]` > 在key集合中移除指定的元素值