@Override
 public Pager<TagsCategoryCollection> pageCollection(
     String categoryCode, Boolean isDirect, Pager<TagsCategoryCollection> page) {
   if (isDirect == null) {
     isDirect = false;
   }
   page.setRecords(tagsCategoryCollectionDao.queryCollection(categoryCode, isDirect, page));
   page.setTotals(tagsCategoryCollectionDao.queryCollectionCount(categoryCode, isDirect));
   return page;
 }
 @Override
 public Integer createTagsCategoryCollection(TagsCategoryCollection tags) {
   tags.setCategoryIndexKey(tagsCategoryDao.queryIndexKeyByCode(tags.getCategoryCode()));
   try {
     tags.setTagsEncode(URLEncoder.encode(tags.getTags(), TagsConst.URL_ENCODE));
   } catch (UnsupportedEncodingException e) {
     e.printStackTrace();
   }
   return tagsCategoryCollectionDao.insertCollection(tags);
 }
 @Override
 public Map<String, String> queryByIndexKey(String indexKey, Integer size) {
   if (size == null) {
     size = MAX_SIZE;
   }
   List<Tags> list = tagsCategoryCollectionDao.queryByIndexKey(indexKey, size);
   Map<String, String> map = new HashMap<String, String>();
   for (Tags t : list) {
     map.put(t.getTags(), t.getTagsEncode());
   }
   return map;
 }
 @Override
 public Map<String, String> queryByCode(String code, Integer depth, Integer size) {
   if (size == null) {
     size = MAX_SIZE;
   }
   if (depth == null) {
     depth = 0;
   }
   List<Tags> list = tagsCategoryCollectionDao.queryByCode(code, depth, size);
   Map<String, String> map = new HashMap<String, String>();
   for (Tags t : list) {
     map.put(t.getTags(), t.getTagsEncode());
   }
   return map;
 }
 @Override
 public Integer deleteTagsCategoryCollection(Integer id) {
   return tagsCategoryCollectionDao.deleteCollectionById(id);
 }