public static void OrderStatistic(List <WxArticle> wxArticles, string serverName) { var wxTargets = System.Configuration.ConfigurationManager.AppSettings["WxNewsTargets"].Split(new char[] { ',' }).ToList(); var wxMassApiList = new List <WxMassApiWrapper>(); foreach (var targetName in wxTargets) { var item = new WxMassApiWrapper(targetName); switch (serverName) { case OrderSource.CIB: case OrderSource.CIBAPP: case OrderSource.CIBVIP: if (targetName != "ERROR") { WxApiRetryBlock.Run(() => item.SendNews(wxArticles)); } break; default: if (targetName == "ALL") { WxApiRetryBlock.Run(() => item.SendNews(wxArticles)); } break; } } }
public static void SendErrorText(string msg) { var massApi = new WxMassApiWrapper("ERROR"); WxApiRetryBlock.Run(() => massApi.SendText($"您有新的消息请查收!\r\n{msg}")); }