예제 #1
0
 @Test
 public void testZ() {
   System.out.println(postDao.getHash("post:data:5").getContent());
   List<Post> list = postDao.getObjectPage(1, 10, "post:list", "post:data:");
   for (Post p : list) {
     System.out.println(p.getContent());
   }
 }
예제 #2
0
 // @Test
 public void testSavePost() {
   Post ps = new Post();
   ps.setAuthor("四六級");
   ps.setContent("d");
   ps.setTitle("d");
   ps.setTime(new Date());
   Map<String, String> map = new HashMap<String, String>();
   map.put("INCR", "userID");
   // postService.save(ps, map);
   // postDao.saveHash(ps, "posts:count", "slug.to.id","slugtest","posts:");
   //  Post post = postDao.getHash("slug.to.id","slugtest","posts:1");
   //  System.out.println(post.getId());
   //   postDao.editHash(1, "slug.to.id","slugtest","slugt");
   //   postDao.saveList("posts:list", "1".getBytes());
   // System.out.println(postDao.getObjectPage(1, 10, "posts:list", "posts:").get(5).getAuthor());
   // postDao.save(ps, map, "data");
   // System.out.println(postDao.getList("Post:*:data").get(0).getAuthor());
   postDao.saveSet("post:1:tags", "章撒登錄".getBytes());
 }