Пример #1
0
 /** 获取回看节目详情 */
 public void getProgramDetail() {
   try {
     Assert.notNull(programId, "节目id不能为空!");
     String url = PROGRAM_DETAIL_URL + "?programId=" + programId;
     String response = HttpUtils.sendGet(url, "utf-8");
     JSONObject jo = JSON.parseObject(response);
     if (null != jo) {
       String ret = jo.getString("ret");
       if (StringUtils.equals("0", ret)) {
         String result = jo.getString("result");
         this.getTestJSON(result);
       }
     }
   } catch (Exception e) {
     logger.error("调用接口getProgramDetail失败", e);
     jsonRet("1", e.getMessage());
   }
 }
Пример #2
0
 /** 获取节目分类列表 */
 @SuppressWarnings("rawtypes")
 public void getProgramTypeList() {
   try {
     String response = HttpUtils.sendGet(PROGRAM_TYPE_LIST_URL, "utf-8");
     JSONObject jo = JSON.parseObject(response);
     if (null != jo) {
       String ret = jo.getString("ret");
       if (StringUtils.equals("0", ret)) {
         String typeList = jo.getString("result");
         if (StringUtils.isNotBlank(typeList)) {
           List<Map> list = JSON.parseArray(typeList, Map.class);
           resultMap.put("rows", list);
         }
         jsonMap();
       }
     }
   } catch (Exception e) {
     logger.error("调用接口getProgramTypeList失败", e);
     jsonRet("1", e.getMessage());
   }
 }