public Response Execute(User currentUser, string request) { var req = JsonConvert.DeserializeObject <Request <GetIMRelatedFilter> >(request); var reqRest = new RestRequest("v4/group_open_http_svc/get_group_shutted_uin", Method.POST); reqRest.AddJsonBody(new { GroupId = req.Filter.ClubId }); var rsp = RestApiHelper.SendIMRequestAndGetResult(reqRest); var data = rsp.ShuttedUinList.Where(e => e.Member_Account == req.Filter.UserCode).First(); Response result = new Response(); result.IsSuccess = true; if (data != null) { result.Tag = true; } else { result.Tag = false; } return(result); }
public Response Execute(User currentUser, string request) { var req = JsonConvert.DeserializeObject <Request <GetIMRelatedFilter> >(request); var reqRest = new RestRequest("v4/group_open_http_svc/get_group_shutted_uin", Method.POST); reqRest.AddJsonBody(new { GroupId = req.Filter.ClubId }); var rsp = RestApiHelper.SendIMRequestAndGetResult(reqRest); int shutUpCount = rsp.ShuttedUinList.Count; int clubUserCount = GetClubGeneralUserCount(req.Filter.ClubId); Response result = new Response(); result.IsSuccess = true; if (shutUpCount == clubUserCount && shutUpCount != 0) { result.Tag = true; } else { result.Tag = false; } return(result); }
/// <summary> /// 获取群成员禁言状态 /// </summary> /// <param name="ClubId"></param> /// <param name="UserCode"></param> /// <returns></returns> public bool GetGroupMemberShutupState(string ClubId, string UserCode) { var reqRest = new RestRequest("v4/group_open_http_svc/get_group_shutted_uin", Method.POST); reqRest.AddJsonBody(new { GroupId = ClubId }); var rsp = RestApiHelper.SendIMRequestAndGetResult(reqRest); IMGroupMember data = null; if (rsp.ShuttedUinList.Count > 0) { data = rsp.ShuttedUinList.Where(e => e.Member_Account == UserCode).FirstOrDefault(); } if (data != null) { return(true);//已禁言 } else { return(false); } }