You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BookingHeChuan/Myshipping.Core/Helper/DingTalkGroupHelper.cs

54 lines
1.7 KiB
C#

using Furion;
using Furion.EventBus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Helper
{
public static class DingTalkGroupHelper
{
/// <summary>
/// 发送钉钉客服群组消息通知
/// </summary>
/// <param name="code">钉钉群配置code</param>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
public static async void SendDingTalkGroupMessage(string code, string title, string content)
{
var evtPub = App.GetService<IEventPublisher>();
await evtPub.PublishAsync(new ChannelEventSource("DingTalkGroup:Send", new
{
code,
title,
content
}));
}
/// <summary>
/// 发送钉钉客服群组消息通知
/// </summary>
/// <param name="code">钉钉群配置code</param>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
/// <param name="atAll">@所有人</param>
/// <param name="atMobiles">@手机号数组</param>
/// <param name="atUserIds">@用户id数组</param>
public static async void SendDingTalkGroupMessage(string code, string title, string content, bool atAll, string[] atMobiles, string[] atUserIds)
{
var evtPub = App.GetService<IEventPublisher>();
await evtPub.PublishAsync(new ChannelEventSource("DingTalkGroup:SendAt", new
{
code,
title,
content,
atAll,
atMobiles,
atUserIds,
}));
}
}
}