这是基于vue-vben-admin 模板适用于abp Vnext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
feijie 710ecaa2f3 feat(docs): 添加微信通知模块文档 1 year ago
..
LINGYUN/Abp/Notifications/WeChat/MiniProgram feat(notifications): 通知数据应交由具体实现者来处理数据 1 year ago
FodyWeavers.xml upgrade(abp): upgrade abp framework to 7.4.0 2 years ago
FodyWeavers.xsd upgrade(abp): upgrade abp framework to 7.4.0 2 years ago
LINGYUN.Abp.Notifications.WeChat.MiniProgram.csproj upgrade abp framework to 8.2.0 2 years ago
README.EN.md feat(docs): 添加微信通知模块文档 1 year ago
README.md feat(docs): 添加微信通知模块文档 1 year ago

README.md

LINGYUN.Abp.Notifications.WeChat.MiniProgram

微信小程序通知发布模块,提供通过微信小程序向用户发送订阅消息的功能。

功能特性

  • 微信小程序订阅消息发送
  • 支持自定义消息模板
  • 支持多语言消息
  • 支持不同环境(开发版、体验版、正式版)
  • 集成ABP通知系统

模块引用

[DependsOn(typeof(AbpNotificationsWeChatMiniProgramModule))]
public class YouProjectModule : AbpModule
{
  // other
}

配置项

注意:此配置项将在下一个微信相关大版本移除,合并到 LINGYUN.Abp.WeChat.MiniProgram.AbpWeChatMiniProgramOptions

{
  "Notifications": {
    "WeChat": {
      "MiniProgram": {
        "DefaultMsgPrefix": "",           // 默认消息头部标记
        "DefaultTemplateId": "",          // 默认小程序模板ID
        "DefaultState": "developer",      // 默认跳转小程序类型:developer(开发版)、trial(体验版)、formal(正式版)
        "DefaultLanguage": "zh_CN"        // 默认小程序语言
      }
    }
  }
}

使用方式

发送通知

public class YourService
{
    private readonly INotificationPublisher _notificationPublisher;

    public YourService(INotificationPublisher notificationPublisher)
    {
        _notificationPublisher = notificationPublisher;
    }

    public async Task SendNotificationAsync()
    {
        await _notificationPublisher.PublishAsync(
            "WeChatMiniProgram.Notification", // 通知名称
            new NotificationData(),           // 通知数据
            userIds: new[] { "userId" },      // 接收用户ID列表
            tenantIds: new[] { "tenantId" }   // 租户ID列表
        );
    }
}

自定义通知处理

public class YourNotificationHandler : 
    INotificationHandler<WeChatMiniProgramNotification>
{
    public async Task HandleNotificationAsync(
        WeChatMiniProgramNotification notification)
    {
        // 处理通知
    }
}

更多文档