상속: cn.jpush.api.common.BaseResult
예제 #1
0
        //GET /v3/schedules?page=
        //获取有效的schedule列表
        public getScheduleResult getSchedule(int pageid)
        {
            Preconditions.checkArgument(pageid > 0, "page should more than 0.");
            jSetting = new JsonSerializerSettings();
            jSetting.NullValueHandling    = NullValueHandling.Ignore;
            jSetting.DefaultValueHandling = DefaultValueHandling.Ignore;
            Console.WriteLine(pageid);
            String url = HOST_NAME_SSL;

            url += PUSH_PATH;
            url += GET_PATH;
            url += pageid.ToString();
            ResponseWrapper   result     = sendGet(url, Authorization(), pageid.ToString());
            getScheduleResult messResult = new getScheduleResult();

            messResult.ResponseResult = result;

            ScheduleListResult scheduleListResult = JsonConvert.DeserializeObject <ScheduleListResult>(result.responseContent, jSetting);

            messResult.page        = scheduleListResult.page;
            messResult.total_pages = scheduleListResult.total_pages;
            messResult.total_count = scheduleListResult.total_count;
            messResult.schedules   = scheduleListResult.schedules;
            return(messResult);
        }
예제 #2
0
        public getScheduleResult getSchedule(int pageid)
        {
            Preconditions.checkArgument(pageid > 0, (object)"page should more than 0.");
            this.jSetting = new JsonSerializerSettings();
            this.jSetting.NullValueHandling    = NullValueHandling.Ignore;
            this.jSetting.DefaultValueHandling = DefaultValueHandling.Ignore;
            Console.WriteLine(pageid);
            ResponseWrapper   responseWrapper   = this.sendGet("https://api.jpush.cn" + "/v3/schedules" + "?page=" + pageid.ToString(), this.Authorization(), pageid.ToString());
            getScheduleResult getScheduleResult = new getScheduleResult();

            getScheduleResult.ResponseResult = responseWrapper;
            ScheduleListResult scheduleListResult = (ScheduleListResult)JsonConvert.DeserializeObject <ScheduleListResult>(responseWrapper.responseContent, this.jSetting);

            getScheduleResult.page        = scheduleListResult.page;
            getScheduleResult.total_pages = scheduleListResult.total_pages;
            getScheduleResult.total_count = scheduleListResult.total_count;
            getScheduleResult.schedules   = scheduleListResult.schedules;
            return(getScheduleResult);
        }