💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 组件源码 /** * <b>方法描述:</b> 设置值(覆盖) <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2020-06-09 17:31:56 <br/> * * @param key * 入参|键|{@link java.lang.String} * @param value * 入参|值|{@link java.lang.String} * @return -1 异常<br/> * 1 成功<br/> */ @Component(label = "设置值(覆盖)", style = "判断型", type = "同步组件", comment = "key 已经存储其他值, SET 就覆写旧值,且无视类型", version = "1.0.0", deprecated = false, author = "admin", date = "2020-06-09 05:31:56") @InParams(param = { @Param(name = "key", comment = "键", type = java.lang.String.class), @Param(name = "value", comment = "值", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) public static ResultBase P_setValue(String key, String value) { try { redisTemplate.opsForValue().set(key, value); return ResultBase.newSuccessResult(); } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTR5001", "设置值(覆盖) 异常:" + AppLog.errorMsg(e)); } } 交易中组件使用方式: ![](https://img.kancloud.cn/90/d5/90d5ba8eccd72caaab26df3d60f3a89c_950x750.jpg) ## 参数说明及示例 键:redis中的key,示例: `"qwer"` 值:设置redis对应key的值,示例: `"asdf"` > key 已经存储其他值, SET 就覆写旧值,且无视类型