public static UserCmsBean query_taoke_item_list_html_online(CmsForm cmsForm) { UserCmsBean userCmsBean = new UserCmsBean(); try { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_token; String user_name = cmsForm.appBean.user_name; String user_taoke_url = "http://" + Constants.api_url + "/" + app_id + "_.html"; //LogUtil.log_str(cmsForm, "user_id=" + user_id + "&app_id=" + app_id + "&member_token=" + user_key ); String body = httpservice.get(user_taoke_url, null); //LogUtil.log_cms_call(cmsForm, "query_taoke_item_list:" + body); string code = StringUtil.subString(body, 0, "<data>", "</data>"); //LogUtil.log_cms_call(cmsForm, "code:" + code); if (!string.IsNullOrEmpty(code)) { userCmsBean.app_id = app_id; userCmsBean.user_id = "" + user_id; ArrayList itemList = new ArrayList(); JsonData jo = JsonMapper.ToObject(code); //string app_id = (String)jo["app_id"]; //string user_id = (String)jo["user_id"]; JsonData itemsList = jo["items_pid"]; for (int i = 0; i < itemsList.Count; i++) { //JsonData jo_item = (String)itemsList[i]; JsonData jo_item = itemsList[i]; string num_iid = (string)jo_item["num_iid"]; string pid = (string)jo_item["pid"]; CmsPlanItem cmsPlanItem = new CmsPlanItem(); cmsPlanItem.num_iid = num_iid; cmsPlanItem.pid = pid; string out_log; ArrayList arrayList = cmsForm.sendSqlUtil.query_cms_item_plan(cmsPlanItem.num_iid + cmsPlanItem.pid, 6, out out_log); if (arrayList.Count <= 0) { //itemList.Add(jo_item.ToString()); itemList.Add(cmsPlanItem); } //LogUtil.log_cms_call(cmsForm, "jo_item:" + jo_item); } userCmsBean.items = itemList; } } catch (Exception) { } cmsForm.appBean.userCmsBean_user = userCmsBean; return(userCmsBean); }
public static UserCmsBean query_taoke_item_list_user(CmsForm cmsForm) { UserCmsBean userCmsBean = new UserCmsBean(); try { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_key; String user_name = cmsForm.appBean.user_name; String user_taoke_url = Constants.user_taoke_url_user; //LogUtil.log_str(cmsForm, "user_id=" + user_id + "&app_id=" + app_id + "&user_key=" + user_key + "&user_token="); //String body = httpservice.get(user_taoke_url, null); String body = httpservice.post_http(user_taoke_url, "user_id=" + user_id + "&app_id=" + app_id + "&user_key=" + user_key + "&user_token=", null); //LogUtil.log_cms_call(cmsForm, "query_taoke_item_list:" + body); //string code = StringUtil.subString(body, 0, "<data>", "</data>"); //LogUtil.log_cms_call(cmsForm, "code:" + code); if (!string.IsNullOrEmpty(body)) { userCmsBean.app_id = app_id; userCmsBean.user_id = "" + user_id; ArrayList itemList = new ArrayList(); //JsonData jo = JsonMapper.ToObject(body); ////string app_id = (String)jo["app_id"]; ////string user_id = (String)jo["user_id"]; //JsonData itemsList = jo["result"]["map"]["items"]; //for (int i = 0; i < itemsList.Count; i++) //{ // JsonData jo_item = (JsonData)itemsList[i]; // itemList.Add(jo_item["num_iid"].ToString()); // //LogUtil.log_cms_call(cmsForm, "jo_item:" + jo_item); //} for (int i = body.IndexOf("items"); (i = body.IndexOf("\"num_iid\"", i)) != -1; i++) { string num_iid = StringUtil.subString(body, i, "\"num_iid\":\"", "\""); CmsPlanItem cmsPlanItem = new CmsPlanItem(); cmsPlanItem.num_iid = num_iid; //cmsPlanItem.pid = pid; itemList.Add(cmsPlanItem); } userCmsBean.items = itemList; } } catch (Exception ex) { //LogUtil.log_cms_call(cmsForm, "query_taoke_item_list:" + ex.ToString()); } cmsForm.appBean.userCmsBean_user = userCmsBean; return(userCmsBean); }
public static UserCmsBean query_taoke_item_list_html(CmsForm cmsForm) { UserCmsBean userCmsBean = new UserCmsBean(); try { HttpService httpservice = cmsForm.httpService; long user_id = cmsForm.appBean.user_id; string app_id = cmsForm.appBean.cms_app_id; String user_key = cmsForm.appBean.user_key; String user_name = cmsForm.appBean.user_name; String user_taoke_url = "http://" + Constants.user_cms_data_url + "/" + app_id + ".html"; //LogUtil.log_str(cmsForm, "user_id=" + user_id + "&app_id=" + app_id + "&user_key=" + user_key + "&user_token="); String body = httpservice.get(user_taoke_url, null); //LogUtil.log_cms_call(cmsForm, "query_taoke_item_list:" + body); string code = StringUtil.subString(body, 0, "<data>", "</data>"); //LogUtil.log_cms_call(cmsForm, "code:" + code); if (!string.IsNullOrEmpty(code)) { userCmsBean.app_id = app_id; userCmsBean.user_id = "" + user_id; ArrayList itemList = new ArrayList(); JsonData jo = JsonMapper.ToObject(code); //string app_id = (String)jo["app_id"]; //string user_id = (String)jo["user_id"]; JsonData itemsList = jo["items"]; for (int i = 0; i < itemsList.Count; i++) { JsonData jo_item = (String)itemsList[i]; CmsPlanItem cmsPlanItem = new CmsPlanItem(); cmsPlanItem.num_iid = jo_item.ToString(); itemList.Add(cmsPlanItem); //LogUtil.log_cms_call(cmsForm, "jo_item:" + jo_item); } userCmsBean.items = itemList; } } catch (Exception) { } cmsForm.appBean.userCmsBean = userCmsBean; return(userCmsBean); }