1.sadd和srem的使用(Set)
redisAdapter.sadd(key1,value1);
jedisAdapter.srem(key1,value1);
2.hmsetStr和hgetAll和hgetStr的使用
public void saveToRedis(String key, Map fieldValue) {
if (!CollectionUtils.isEmpty(fieldValue)) {
jedisAdapter.hmsetStr(key, fieldValue);
}
}
返回这个key下面所有的map结构
jedisAdapter.hgetAll(MarketRedisKey.MARKET_MM_SPOTVM);
返回指定的field
String flag = jedisAdapter.hgetStr(QUOTE_RESET_VALUEDATE_FLAG, field);
3.hsetStr和hgetStr的使用
jedisAdapter.hsetStr(Constants.ORDER_BOND_QUOTE, talkOrderId, JacksonUtil.obj2json(cashBondTalkQuoteRequest));
String json = jedisAdapter.hgetStr(Constants.ORDER_BOND_QUOTE, dbData.getOrderId());
4.setStr和getStr的使用
jedisAdapter.setStr(cacheMarketRedisKey, JacksonUtil.tryObj2json(sourcePricePojo));
String marketPrice = jedisAdapter.getStr(getCacheMarketRedisKey(businessType, feedCode, pair, farTenor));
================================================redis锁==================================
1.
标签:key,技巧,QUOTE,redis,jedisAdapter,hgetStr,操作,String From: https://www.cnblogs.com/wxynb/p/18008566