Exemple #1
0
        public static async Task <PullEventsResponseDto> PullEventsAsync()
        {
            const string action  = "PullEvents";
            const string version = "2018-07-17";

            //组装Url
            var api = new StringBuilder()
                      .Append($"{baseApi}?")
                      .ToString();

            return(await TCRestClientUtil.TCGetRequst <PullEventsResponseDto>(serviceName,
                                                                              hostName, api.Split("?")[1], api, action, version));
        }
Exemple #2
0
        public static async Task <BaseTencentRespnseV2> ResumeLiveStreamAsync(ResumeLiveStreamRequestDto dto)
        {
            const string action  = "ResumeLiveStream";
            const string version = "2018-08-01";

            //组装Url
            var api = new StringBuilder()
                      .Append($"{baseApi}?")
                      .Append($"DomainName={CloudLiveConfig.LivePushDomain}")
                      .Append($"&AppName=live")
                      .Append($"&StreamName={dto.StreamName}")
                      .ToString();

            return(await TCRestClientUtil.TCGetRequst <BaseTencentRespnseV2>("live",
                                                                             hostName, api.Split("?")[1], api, action, version));
        }
Exemple #3
0
        public static async Task <BaseTencentRespnseV2> ForbidLiveStreamAsync(ForbidLiveStreamRequestDto dto)
        {
            const string action     = "ForbidLiveStream";
            const string version    = "2018-08-01";
            var          resumeTime = dto.ResumeTime?.ToString("YYYY-MM-DDThh:mm:ssZ")
                                      ?? DateTime.Now.AddDays(7).ToString("YYYY-MM-DDThh:mm:ssZ");
            //组装Url
            var api = new StringBuilder()
                      .Append($"{baseApi}?")
                      .Append($"DomainName={CloudLiveConfig.LivePushDomain}")
                      .Append($"&AppName=live")
                      .Append($"&StreamName={dto.StreamName}")
                      .Append($"&ResumeTime={resumeTime}")
                      .Append($"$Reason={dto.Reason}")
                      .ToString();

            return(await TCRestClientUtil.TCGetRequst <BaseTencentRespnseV2>("live",
                                                                             hostName, api.Split("?")[1], api, action, version));
        }