/**
   * 根据分类id,查询当前分类下的公共连接列表
   *
   * @param typeid 分类id
   * @param page 当前页
   * @param pageNum 每页显示条数
   * @return 当前分类下的公共连接列表
   */
  @GET
  @Path("/list/commonlink/{typeid}")
  @Produces({MediaType.APPLICATION_JSON})
  public JSONObject findCommonlinkListByTypeId(
      @PathParam("typeid") String typeid,
      @DefaultValue("1") @QueryParam("page") int page,
      @DefaultValue("10") @QueryParam("pagenum") int pageNum) {
    JSONObject result = new JSONObject();
    JSONArray jsonArray = new JSONArray();
    result.put("count", 0);
    result.put("commonlinklist", jsonArray);
    HttpSession session = request.getSession();
    User user = (User) session.getAttribute("loginUser");
    if (null != user) {
      PageBounds pb = PageBoundsUtil.PageBoundsOrderExtend("orderId.desc");
      pb.setPage(page);
      pb.setLimit(pageNum);

      Commonlink commonlink = new Commonlink();
      commonlink.setUserId(String.valueOf(user.getId()));
      commonlink.setTypeId(typeid);

      // 获取公共连接分类列表
      Pager<Commonlink> commonLinkPage =
          commonlinkService.findCommonlinkListByTypeId(commonlink, pb);
      if (null != commonLinkPage && commonLinkPage.getTotal() > 0) {
        result.put("count", commonLinkPage.getTotal());
        buildCommonlinkListToJSONAarray(commonLinkPage, jsonArray);
      }
    }
    return result;
  }