/// <summary> /// 设置成员新消息免打扰 /// </summary> /// <param name="accessToken"></param> /// <param name="body"></param> /// <param name="requestUrl"></param> /// <returns></returns> /// <remarks>该接口可设置成员接收到的消息是否提醒。主要场景是用于对接企业im的在线状态,如成员处于在线状态时,可以设置该成员的消息免打扰。当成员离线时,关闭免打扰状态,对微信端进行提醒。</remarks> public Models.SendingResult SetMute(string accessToken, SetMute body, string requestUrl = "https://qyapi.weixin.qq.com/cgi-bin/chat/setmute") { using (WebClient client = new WebClient()) { client.Headers.Add(HttpRequestHeader.ContentType, "application/json"); byte[] bytes = client.UploadData($"{requestUrl}?access_token={accessToken}", "POST", body.ToBytes()); return(bytes.ConvertTo <SendingResult>()); } }
public void SetMuteTest() { SetMute request = new SetMute(); var result = JsonConvert.DeserializeObject <KodiJSON.Application.Response.SetMuteResponse>(ExecuteTest.GetResponse(request)); }
public void CallSetMuteOnIMediaPlayer([Frozen] IMediaPlayer mediaPlayer, Stream outStream, SetMute message, RequestService sut) { sut.CanHandleMessage(mediaPlayer, message, outStream); mediaPlayer.Received(1).SetMute(message.IsMuted); }