public IHttpActionResult Main(string userName) { var body = new RequestBody(); if (!body.IsAdministratorLoggin) { return(Unauthorized()); } var list = new List <object>(); var unCheckedList = CheckManager.GetUserCountListUnChecked(body.AdministratorName); if (unCheckedList.Count <= 0) { return(Ok(list)); } var dict = new Dictionary <int, int>(); foreach (var pair in unCheckedList) { var publishmentSystemId = pair.Key; var count = pair.Value; if (dict.ContainsKey(publishmentSystemId)) { dict[publishmentSystemId] = dict[publishmentSystemId] + count; } else { dict[publishmentSystemId] = count; } } foreach (var publishmentSystemId in dict.Keys) { var count = dict[publishmentSystemId]; if (!PublishmentSystemManager.IsExists(publishmentSystemId)) { continue; } list.Add(new { Url = PageContentCheck.GetRedirectUrl(publishmentSystemId), SiteName = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId).PublishmentSystemName, Count = count }); } return(Ok(list)); }
public IHttpActionResult Main(string userName) { var request = new AuthRequest(); if (!request.IsAdminLoggin) { return(Unauthorized()); } var list = new List <object>(); var unCheckedList = CheckManager.GetUserCountListUnChecked(request.AdminPermissions); if (unCheckedList.Count <= 0) { return(Ok(list)); } var dict = new Dictionary <int, int>(); foreach (var pair in unCheckedList) { var siteId = pair.Key; var count = pair.Value; if (dict.ContainsKey(siteId)) { dict[siteId] = dict[siteId] + count; } else { dict[siteId] = count; } } foreach (var siteId in dict.Keys) { var count = dict[siteId]; if (!SiteManager.IsExists(siteId)) { continue; } list.Add(new { Url = PageContentCheck.GetRedirectUrl(siteId), SiteManager.GetSiteInfo(siteId).SiteName, Count = count }); } return(Ok(list)); }