コード例 #1
0
  /** @Title: deleteTag @Description: TODO(删除tag) */
  @RequestMapping(value = "/deleteTag.do", method = RequestMethod.POST)
  @ResponseBody
  public Map<String, Object> deleteTag(HttpServletRequest request) {
    String idstr = request.getParameter("tagid");
    String[] id = StringUtil.splitString(idstr, ";");
    // systemService.deleteAll(TBRssTag.class, id, null);

    for (String string : id) {
      TBRssTag tag = (TBRssTag) systemService.getClassById(TBRssTag.class, string);
      List<TBRssTag> list =
          systemService.findByQueryHql("from TBRss where source = '" + tag.getTagname() + "' ");
      systemService.delete(tag);
      systemService.deleteAll(list);
    }
    /*
     * 重新获取标签返回
     */
    Map<String, Object> map = new HashMap<String, Object>();
    String hql =
        "from TBRssTag where macaddr ='"
            + IpUtils.getMacAddress()
            + "' order by createtime desc"; // 采用本机上,可以看本机的信息,伪cooikes的行为

    List<TBRssTag> list = systemService.findByQueryHql(hql);
    map.put("list", list);
    return map;
  }
コード例 #2
0
  /** @Title: tab_selftag @Description: TODO(添加自己的tag) */
  @RequestMapping(value = "/addSelfTag.do", method = RequestMethod.POST)
  @ResponseBody
  public Map<String, Object> tab_selftag(HttpServletRequest request) {
    String feedurl = request.getParameter("feedurl");
    Map<String, Object> map = new HashMap<String, Object>();
    if (!"".equals(feedurl) && null != feedurl) {
      map.put("list", savetag(feedurl));
      return map;
    }
    String hql =
        "from TBRssTag where macaddr ='"
            + IpUtils.getMacAddress()
            + "' order by createtime desc"; // 采用本机上,可以看本机的信息,伪cooikes的行为

    List<TBRssTag> list = systemService.findByQueryHql(hql);
    map.put("list", list);
    return map;
  }