多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 组件源码 /** * <b>方法描述:</b> 获取值(批量) <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2020-06-09 17:49:13 <br/> * * @param keys * 入参|键|{@link java.util.List} * @param list * 出参|列表|{@link java.util.List} * @return -1 异常<br/> * 1 成功<br/> */ @Component(label = "获取值(批量)", style = "判断型", type = "同步组件", comment = "key不存在,类型不是String,反回nil,操作不会失败,", version = "1.0.0", deprecated = false, author = "admin", date = "2020-06-09 05:49:13") @InParams(param = { @Param(name = "keys", comment = "键", type = java.util.List.class) }) @OutParams(param = { @Param(name = "list", comment = "列表", type = java.util.List.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) public static ResultBase P_getByKeys(List keys) { try { List list = redisTemplate.opsForValue().multiGet(keys); return ResultBase.newSuccessResult(list); } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTR5005", "key不是String类型结构"); } } 交易中组件使用方式: ![](https://img.kancloud.cn/75/69/75699a09ebbe216abf5619c1613b49b1_950x750.jpg) ## 参数说明及示例 键:批量获取值的key集合,示例: `["1","2","3","4","5"]` 列表:通过key获取的redis中的值,示例: `__INNER__["result"]` > key不存在,类型不是String,反回nil,操作不会失败