@POST
 @Consumes("application/json")
 public Long create(JsonNode node) {
   long timestamp = new DateTime(DateTimeZone.UTC).getMillis();
   setOps.add(DUMMY_USER, node, timestamp);
   return timestamp;
 }
 @PUT
 @Path("{createdAt}")
 @Consumes("application/json")
 public void update(@PathParam("createdAt") long createdAt, JsonNode node) {
   setOps.add(DUMMY_USER, node, createdAt);
 }
示例#3
0
 /**
  * Sort-Set数据类型 key绑定的set里新增value元素
  *
  * @param key
  * @param objValue 可序列话的对象
  * @param score 得分
  * @return true插入成功 false失败(元素已经存在)
  */
 public boolean addZSet(String key, Serializable objValue, Double score) {
   zSetOps = redisTemplate.opsForZSet();
   return zSetOps.add(key, objValue, score);
 }