EasyAbp.NotificationService.Provider.Dingtalk
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EasyAbp.NotificationService.Provider.Dingtalk --version 1.0.0
NuGet\Install-Package EasyAbp.NotificationService.Provider.Dingtalk -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyAbp.NotificationService.Provider.Dingtalk" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyAbp.NotificationService.Provider.Dingtalk" Version="1.0.0" />
<PackageReference Include="EasyAbp.NotificationService.Provider.Dingtalk" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasyAbp.NotificationService.Provider.Dingtalk --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasyAbp.NotificationService.Provider.Dingtalk, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EasyAbp.NotificationService.Provider.Dingtalk@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EasyAbp.NotificationService.Provider.Dingtalk&version=1.0.0
#tool nuget:?package=EasyAbp.NotificationService.Provider.Dingtalk&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasyAbp.NotificationService.Dingtalk
基于EasyAbp.NotificationService的钉钉机器人消息通知
使用方式:
安装EasyAbp
安装EasyAbp.NotificationService.Provider.Dingtalk
dotnet add package EasyAbp.NotificationService.Provider.Dingtalk --version 1.0.0
- 添加moduel依赖
[DependsOn(
typeof(NotificationServiceProviderDingtalkModule)
)]
- 配置钉钉,appsettings.json中添加:
"Dingtalk": {
"AppKey": "你的appkey",
"AppSecret": "你的appsecret",
"RedirectUri": "忽略",
"WebHookAesKey": "忽略",
"WebHookToken": "忽略",
"RobotCode": "你的钉钉机器人RobotCode"
}
- 实现IDingtalkUserIdProvider
[Dependency(ReplaceServices = true, TryRegister = true)]
public class DingtalkUserIdProvider : IDingtalkUserIdProvider , ITransientDependency
{
public DingtalkUserIdProvider(r)
{
}
public async Task<string> GetOrNullAsync(string appId, Guid userId)
{
//实现业务系统用户和钉钉用户的转换
}
public async Task<string> GetOrNullAsync(Guid userId)
{
// 实现业务系统用户和钉钉用户的转换
}
}
- 发送消息, 注入DingtalkRobotInteractiveCardNotificationFactory
var eto = await _dingtalkRobotInteractiveCardNotificationFactory.CreateAsync(new DingtalkRobotInteractiveCardDataModel()
{
CardBizId = "你的消息id",
CardData = new
{
config = new
{
autoLayout = true,
enableForward = true,
},
header = new
{
title = new
{
type = "text",
text = $"消息标题"
},
logo = "@lALPDfJ6V_FPDmvNAfTNAfQ"
},
contents = new List<object>()
{
new
{
type = "section",
fields = new
{
list = new List<object>
{
new
{
type = "text",
text = $"消息正文段落1",
},
new
{
type = "text",
text = $"消息正文段落2",
},
new
{
type = "text",
text = $"消息正文段落3",
},
new
{
type = "text",
text = $"消息正文段落4",
}
}
}
}
}
}
}, userIds);
await _localEventBus.PublishAsync(eto);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- EasyAbp.NotificationService.Domain (>= 2.3.0)
- EasyAbp.NotificationService.Provider.Dingtalk.Abstractions (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.