Exemplo n.º 1
0
        public static bool submit_taoke_item_plan(CmsForm cmsForm, TaokeItem taokeItem)
        {
            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_create_url_plan = Constants.user_taoke_create_url_plan;
            //string datastr = String.Concat(
            //     "user_id=" + user_id
            //    , "&member_token=" + user_key
            //    , "&app_id=" + app_id
            //    , "&num_iid=" + taokeItem.num_iid
            //    , "&pid=" + taokeItem.pid
            //    , "&url=" + taokeItem.short_url
            //    , "&tao_token=" + taokeItem.tao_token
            //    , "&market_create_date=" + taokeItem.couponEffectiveStartTime
            //    , "&market_end_date=" + taokeItem.couponEffectiveEndTime
            //);
            ////LogUtil.log_cms_call(cmsForm, datastr);
            //String body = httpservice.post_http(user_taoke_create_url_plan, datastr, null);

            ////CmsUtil.add_queue_taoke_plan_url(cmsForm, taokeItem);
            return(true);
        }
Exemplo n.º 2
0
        public static ArrayList query_taoke_item_list(CmsForm cmsForm)
        {
            ArrayList list = new ArrayList();

            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;
                //LogUtil.log_str(cmsForm, "user_id=" + user_id + "&app_id=" + app_id + "&user_key=" + user_key + "&user_token=");
                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);

                for (int i = body.IndexOf("items"); (i = body.IndexOf("\"num_iid\"", i)) != -1; i++)
                {
                    TaokeItem taokeItem = new TaokeItem();
                    taokeItem.num_iid     = StringUtil.subString(body, i, "\"num_iid\":\"", "\"");
                    taokeItem.user_id     = StringUtil.subString(body, i, "\"user_id\":\"", "\"");
                    taokeItem.app_id      = StringUtil.subString(body, i, "\"app_id\":\"", "\"");
                    taokeItem.activity_id = StringUtil.subString(body, i, "\"activity_id\":\"", "\"");
                    taokeItem.user_num_id = StringUtil.subString(body, i, "\"user_num_id\":\"", "\"");
                    taokeItem.pic_url     = StringUtil.subString(body, i, "\"pic_url\":\"", "\"");
                    //taokeItem.title = StringUtil.subString(body, i, "\"title\":\"", "\"");
                    String goods_title = StringUtil.subString(body, i, "\"title\":\"", "\"");
                    goods_title     = UnicodeUtil.Unicode2String(goods_title);
                    taokeItem.title = goods_title;

                    taokeItem.tkRate       = double.Parse(StringUtil.subString(body, i, "\"common_commission_rate\":\"", "\""));
                    taokeItem.taoke_status = int.Parse(StringUtil.subString(body, i, "\"taoke_status\":", ","));
                    //taokeItem.taoke_status_err = StringUtil.subString(body, i, "\"taoke_status_err\":\"", "\"");
                    String taoke_status_err = StringUtil.subString(body, i, "\"taoke_status_err\":\"", "\"");
                    taoke_status_err           = UnicodeUtil.Unicode2String(taoke_status_err);
                    taokeItem.taoke_status_err = taoke_status_err;
                    list.Add(taokeItem);
                }
            }
            catch (Exception)
            {
            }
            return(list);
        }