//自动发送操作 //针对设定的目标对结果进行筛选 #endregion #region 获取在运行的消息规则列表 public string GetMsgRuleList(int pageIndex, int ruleType, string sendMethod, string name, string target) { ListView viewModel = new ListView(); if (ruleType == 1 || ruleType == -99)//触发类消息处理 { if (!string.IsNullOrEmpty(sendMethod)) { string[] methodList = sendMethod.Split(','); viewModel = MessageTemplateBLL.GetTemplateList(pageIndex, methodList, target, name); } else { viewModel = MessageTemplateBLL.GetTemplateList(pageIndex, null, target, name); } if (viewModel != null) { return(CommonLib.Helper.JsonSerializeObject(viewModel)); } else { return(""); } } else { return(""); } }
/// <summary> /// 从模板生成发送批次并自动发送 /// </summary> /// <param name="id"></param> /// <param name="eventName"></param> /// <param name="specModel"></param> /// <param name="accid"></param> /// <param name="uid"></param> /// <param name="uName"></param> /// <returns></returns> public static int SendNotifyMsg(int id, string eventName, string specModel, int accid, int uid, string uName) { //获取模板 TriggerTemplateModel tModel = MessageTemplateBLL.GetModelById(id); try { //拆解模板并生成批次 string batchId = GenerateBatchByTemplate(tModel, accid, eventName, specModel, id); MessageSysControl.SendMsgAuto(batchId, uid, uName); return(1); } catch (Exception ex) { Logger.Error("获取前台消息发送信息出错!", ex); return(0); } }
/// <summary> /// 获取全部Kafka事件 /// (当事件数比较多的时候从数据库获取) /// (暂在页面处理) /// </summary> /// <returns></returns> public string GetAllKafkaEvent() { return(CommonLib.Helper.JsonSerializeObject(MessageTemplateBLL.GetAllKafkaEvent())); }
public static string AddTemplate(TriggerTemplateModel model) { return(MessageTemplateBLL.AddTemplate(model)); }