public async Task <WorkFlowResult> UrgeAsync([FromBody] UrgeDto urge) { var workflowResult = await _workFlowInstanceService.UrgeAsync(urge); if (!workflowResult.Result) { return(workflowResult); } var urgeTypeArray = urge.UrgeType.Split(',').Where(m => !string.IsNullOrEmpty(m)); List <long> urgeUserList = workflowResult.Data.ToString().Split(',') .Where(m => !string.IsNullOrEmpty(m)) .Select(m => Convert.ToInt64(m)).ToList(); MessagePushSomBodyDTO model = new MessagePushSomBodyDTO { UserIds = urgeUserList, Title = urge.Title, MsgJson = urge.UrgeContent, Sender = urge.Sender.ToInt64(), Link = urge.Link }; foreach (var item in urgeTypeArray) { UrgeType urgeType = (UrgeType)item.ToInt32(); switch (urgeType) { case UrgeType.EMail: UrgeSendEMail(); break; case UrgeType.SMS: UrgeSendSMS(); break; case UrgeType.WeChat: UrgeSendWeChat(); break; case UrgeType.SignalR: default: await UrgeSendSignalR(model); break; } } return(WorkFlowResult.Success()); }
public async Task <WorkFlowResult> UrgeAsync([FromBody] UrgeDto urge) { urge.Sender = UserIdentity.UserId.ToString(); return(await _workFlowInstanceService.UrgeAsync(urge)); }