🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 组件源码 /** * <b>方法描述:</b> 获取数据结构类型 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-09 10:33:35 <br/> * * @param key * 入参|key|{@link java.lang.String} * @param type * 出参|数据结构类型|{@link java.lang.String} * @return -1 异常<br/> * 1 成功<br/> */ @Component(label = "获取数据结构类型", style = "判断型", type = "同步组件", comment = "反回none表示key不存在", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-09 10:33:35") @InParams(param = { @Param(name = "key", comment = "key", type = java.lang.String.class) }) @OutParams(param = { @Param(name = "type", comment = "数据结构类型", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) public static ResultBase P_type(String key) { try { String type = redisTemplate.type(key).code(); return ResultBase.newSuccessResult(type); } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTR3009", "获取数据结构类型 异常:" + AppLog.errorMsg(e)); } } 交易中组件使用方式: ![](https://img.kancloud.cn/ab/2d/ab2d822f6fb8b6e0e4aa3603f8ee4026_1193x1135.jpg) ## 参数说明及示例 key:redis中存在的key,示例: `"key"` 数据结构类型:redis中存在的key对应的数据结构类型,示例: `__INNER__["type"]` > 反回none表示key不存在