4 changed files with 362 additions and 0 deletions
@ -0,0 +1,80 @@ |
|||||
|
# LINGYUN.Abp.PushPlus.SettingManagement |
||||
|
|
||||
|
PushPlus settings management module, providing management interface and API endpoints for PushPlus configuration. |
||||
|
|
||||
|
## Features |
||||
|
|
||||
|
* Provides PushPlus configuration management API |
||||
|
* Supports global configuration management |
||||
|
* Supports tenant configuration management |
||||
|
* Supports multilingual |
||||
|
* Integrates with ABP settings management module |
||||
|
|
||||
|
## Installation |
||||
|
|
||||
|
```bash |
||||
|
dotnet add package LINGYUN.Abp.PushPlus.SettingManagement |
||||
|
``` |
||||
|
|
||||
|
## Module Dependencies |
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpPushPlusSettingManagementModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## API Endpoints |
||||
|
|
||||
|
### Get Global Configuration |
||||
|
|
||||
|
```http |
||||
|
GET /api/setting-management/push-plus/by-global |
||||
|
``` |
||||
|
|
||||
|
Response example: |
||||
|
```json |
||||
|
{ |
||||
|
"name": "PushPlus", |
||||
|
"displayName": "PushPlus Configuration", |
||||
|
"settings": [ |
||||
|
{ |
||||
|
"name": "PushPlus.Security.Token", |
||||
|
"value": "your-token", |
||||
|
"displayName": "Token", |
||||
|
"description": "Token obtained from PushPlus platform" |
||||
|
}, |
||||
|
{ |
||||
|
"name": "PushPlus.Security.SecretKey", |
||||
|
"value": "your-secret", |
||||
|
"displayName": "Secret Key", |
||||
|
"description": "Secret key obtained from PushPlus platform" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
### Get Tenant Configuration |
||||
|
|
||||
|
```http |
||||
|
GET /api/setting-management/push-plus/by-current-tenant |
||||
|
``` |
||||
|
|
||||
|
Response format is the same as global configuration. |
||||
|
|
||||
|
## Permissions |
||||
|
|
||||
|
* Abp.PushPlus.ManageSetting - Permission to manage PushPlus configuration |
||||
|
|
||||
|
## Localization |
||||
|
|
||||
|
The module supports the following languages: |
||||
|
* Simplified Chinese |
||||
|
* English |
||||
|
|
||||
|
## More Information |
||||
|
|
||||
|
* [LINGYUN.Abp.PushPlus](../LINGYUN.Abp.PushPlus/README.md) |
||||
|
* [ABP Settings Management](https://docs.abp.io/en/abp/latest/Settings) |
||||
@ -0,0 +1,80 @@ |
|||||
|
# LINGYUN.Abp.PushPlus.SettingManagement |
||||
|
|
||||
|
PushPlus 设置管理模块,提供 PushPlus 配置的管理界面和API接口。 |
||||
|
|
||||
|
## 功能特性 |
||||
|
|
||||
|
* 提供 PushPlus 配置管理接口 |
||||
|
* 支持全局配置管理 |
||||
|
* 支持租户配置管理 |
||||
|
* 支持多语言 |
||||
|
* 集成 ABP 设置管理模块 |
||||
|
|
||||
|
## 安装 |
||||
|
|
||||
|
```bash |
||||
|
dotnet add package LINGYUN.Abp.PushPlus.SettingManagement |
||||
|
``` |
||||
|
|
||||
|
## 模块引用 |
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpPushPlusSettingManagementModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## API接口 |
||||
|
|
||||
|
### 获取全局配置 |
||||
|
|
||||
|
```http |
||||
|
GET /api/setting-management/push-plus/by-global |
||||
|
``` |
||||
|
|
||||
|
响应示例: |
||||
|
```json |
||||
|
{ |
||||
|
"name": "PushPlus", |
||||
|
"displayName": "PushPlus配置", |
||||
|
"settings": [ |
||||
|
{ |
||||
|
"name": "PushPlus.Security.Token", |
||||
|
"value": "your-token", |
||||
|
"displayName": "Token", |
||||
|
"description": "PushPlus平台获取的Token" |
||||
|
}, |
||||
|
{ |
||||
|
"name": "PushPlus.Security.SecretKey", |
||||
|
"value": "your-secret", |
||||
|
"displayName": "密钥", |
||||
|
"description": "PushPlus平台获取的密钥" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
### 获取租户配置 |
||||
|
|
||||
|
```http |
||||
|
GET /api/setting-management/push-plus/by-current-tenant |
||||
|
``` |
||||
|
|
||||
|
响应格式同全局配置。 |
||||
|
|
||||
|
## 权限 |
||||
|
|
||||
|
* Abp.PushPlus.ManageSetting - 管理PushPlus配置的权限 |
||||
|
|
||||
|
## 本地化 |
||||
|
|
||||
|
模块支持以下语言: |
||||
|
* 中文简体 |
||||
|
* 英文 |
||||
|
|
||||
|
## 更多信息 |
||||
|
|
||||
|
* [LINGYUN.Abp.PushPlus](../LINGYUN.Abp.PushPlus/README.md) |
||||
|
* [ABP设置管理](https://docs.abp.io/en/abp/latest/Settings) |
||||
@ -0,0 +1,122 @@ |
|||||
|
# LINGYUN.Abp.PushPlus |
||||
|
|
||||
|
Integration with PushPlus |
||||
|
|
||||
|
Implements PushPlus related API documentation, providing PushPlus open capabilities. |
||||
|
|
||||
|
For details, see PushPlus documentation: https://www.pushplus.plus/doc/guide/openApi.html |
||||
|
|
||||
|
## Module Dependencies |
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpPushPlusModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Features |
||||
|
|
||||
|
* PushPlus PushPlus feature group |
||||
|
* PushPlus.Message.Enable Enable PushPlus message channel globally |
||||
|
* PushPlus.Channel.WeChat WeChat public account message channel |
||||
|
* PushPlus.Channel.WeChat.Enable Enable WeChat public account message channel |
||||
|
* PushPlus.Channel.WeChat.SendLimit WeChat public account message channel send limit |
||||
|
* PushPlus.Channel.WeChat.SendLimitInterval WeChat public account message channel limit period (days) |
||||
|
* PushPlus.Channel.WeWork WeWork message channel |
||||
|
* PushPlus.Channel.WeWork.Enable Enable WeWork message channel |
||||
|
* PushPlus.Channel.WeWork.SendLimit WeWork message channel send limit |
||||
|
* PushPlus.Channel.WeWork.SendLimitInterval WeWork message channel limit period (days) |
||||
|
* PushPlus.Channel.Webhook Webhook message channel |
||||
|
* PushPlus.Channel.Webhook.Enable Enable Webhook message channel |
||||
|
* PushPlus.Channel.Webhook.SendLimit Webhook message channel send limit |
||||
|
* PushPlus.Channel.Webhook.SendLimitInterval Webhook message channel limit period (days) |
||||
|
* PushPlus.Channel.Email Email message channel |
||||
|
* PushPlus.Channel.Email.Enable Enable Email message channel |
||||
|
* PushPlus.Channel.Email.SendLimit Email message channel send limit |
||||
|
* PushPlus.Channel.Email.SendLimitInterval Email message channel limit period (days) |
||||
|
* PushPlus.Channel.Sms SMS message channel |
||||
|
* PushPlus.Channel.Sms.Enable Enable SMS message channel |
||||
|
* PushPlus.Channel.Sms.SendLimit SMS message channel send limit |
||||
|
* PushPlus.Channel.Sms.SendLimitInterval SMS message channel limit period (days) |
||||
|
|
||||
|
## Configuration |
||||
|
|
||||
|
```json |
||||
|
{ |
||||
|
"PushPlus": { |
||||
|
"Security": { |
||||
|
"Token": "your-pushplus-token", // Token obtained from PushPlus platform |
||||
|
"SecretKey": "your-pushplus-secret" // Secret key obtained from PushPlus platform |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Basic Usage |
||||
|
|
||||
|
1. Configure PushPlus Credentials |
||||
|
* Get Token and Secret key from PushPlus platform |
||||
|
* Set Token and Secret key in configuration file |
||||
|
|
||||
|
2. Send Messages |
||||
|
```csharp |
||||
|
public class YourService |
||||
|
{ |
||||
|
private readonly IPushPlusMessageSender _messageSender; |
||||
|
|
||||
|
public YourService(IPushPlusMessageSender messageSender) |
||||
|
{ |
||||
|
_messageSender = messageSender; |
||||
|
} |
||||
|
|
||||
|
public async Task SendMessageAsync() |
||||
|
{ |
||||
|
// Send WeChat message |
||||
|
await _messageSender.SendWeChatAsync( |
||||
|
title: "Message Title", |
||||
|
content: "Message Content", |
||||
|
topic: "Optional Topic", |
||||
|
template: PushPlusMessageTemplate.Html |
||||
|
); |
||||
|
|
||||
|
// Send WeWork message |
||||
|
await _messageSender.SendWeWorkAsync( |
||||
|
title: "Message Title", |
||||
|
content: "Message Content" |
||||
|
); |
||||
|
|
||||
|
// Send Email |
||||
|
await _messageSender.SendEmailAsync( |
||||
|
title: "Email Title", |
||||
|
content: "Email Content" |
||||
|
); |
||||
|
|
||||
|
// Send SMS |
||||
|
await _messageSender.SendSmsAsync( |
||||
|
title: "SMS Title", |
||||
|
content: "SMS Content" |
||||
|
); |
||||
|
|
||||
|
// Send Webhook message |
||||
|
await _messageSender.SendWebhookAsync( |
||||
|
title: "Message Title", |
||||
|
content: "Message Content", |
||||
|
webhook: "webhook-url" |
||||
|
); |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Message Templates |
||||
|
|
||||
|
* Html - HTML format (default) |
||||
|
* Text - Plain text format |
||||
|
* Json - JSON format |
||||
|
* Markdown - Markdown format |
||||
|
|
||||
|
## More Information |
||||
|
|
||||
|
* [PushPlus Documentation](https://www.pushplus.plus/doc/guide/openApi.html) |
||||
|
* [ABP Framework](https://abp.io/) |
||||
Loading…
Reference in new issue