首页 > 代码库 > Jedis

Jedis

public class jredis {
  
  public static void main(String[] args) {
  
    Map<String, String> map = new HashMap<>();
    List<String> list;
    Jedis jedis = new Jedis("192.168.31.103", 6379);
    jedis.auth("111111");
    String aa = "asdfa";
    map.put("openid", "alsdkjfpo");
    map.put("token", "asdfsdf");
    jedis.hmset("user1", map);
    jedis.expire("user1", 10);
    
    list = jedis.hmget(aa, "token", "openid");
    
    System.out.println(list);
    
    
  }
}

 

Jedis