131 changed files with 21932 additions and 278 deletions
File diff suppressed because it is too large
@ -0,0 +1,170 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Metadata; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class AddMessageCenter : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "AppPlatformEmailMessages", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
From = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Subject = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsBodyHtml = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
CC = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Normalize = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
Priority = table.Column<int>(type: "int", nullable: true), |
|||
BodyTransferEncoding = table.Column<int>(type: "int", nullable: true), |
|||
DeliveryNotificationOptions = table.Column<int>(type: "int", nullable: true), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
UserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
Sender = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Provider = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Receiver = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Content = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
SendTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
SendCount = table.Column<int>(type: "int", nullable: false), |
|||
Status = table.Column<int>(type: "int", nullable: false, defaultValue: -1), |
|||
Reason = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AppPlatformEmailMessages", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AppPlatformSmsMessages", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
UserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
Sender = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Provider = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Receiver = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Content = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
SendTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
SendCount = table.Column<int>(type: "int", nullable: false), |
|||
Status = table.Column<int>(type: "int", nullable: false, defaultValue: -1), |
|||
Reason = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AppPlatformSmsMessages", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AppPlatformEmailMessageAttachments", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<long>(type: "bigint", nullable: false) |
|||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), |
|||
MessageId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
BlobName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Size = table.Column<long>(type: "bigint", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AppPlatformEmailMessageAttachments", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_AppPlatformEmailMessageAttachments_AppPlatformEmailMessages_~", |
|||
column: x => x.MessageId, |
|||
principalTable: "AppPlatformEmailMessages", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AppPlatformEmailMessageHeaders", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<long>(type: "bigint", nullable: false) |
|||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), |
|||
MessageId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Key = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Value = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AppPlatformEmailMessageHeaders", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_AppPlatformEmailMessageHeaders_AppPlatformEmailMessages_Mess~", |
|||
column: x => x.MessageId, |
|||
principalTable: "AppPlatformEmailMessages", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AppPlatformEmailMessageAttachments_MessageId", |
|||
table: "AppPlatformEmailMessageAttachments", |
|||
column: "MessageId"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AppPlatformEmailMessageHeaders_MessageId", |
|||
table: "AppPlatformEmailMessageHeaders", |
|||
column: "MessageId"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AppPlatformEmailMessageAttachments"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AppPlatformEmailMessageHeaders"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AppPlatformSmsMessages"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AppPlatformEmailMessages"); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,54 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class RemoveMessageStatusDefaultValue : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<int>( |
|||
name: "Status", |
|||
table: "AppPlatformSmsMessages", |
|||
type: "int", |
|||
nullable: false, |
|||
oldClrType: typeof(int), |
|||
oldType: "int", |
|||
oldDefaultValue: -1); |
|||
|
|||
migrationBuilder.AlterColumn<int>( |
|||
name: "Status", |
|||
table: "AppPlatformEmailMessages", |
|||
type: "int", |
|||
nullable: false, |
|||
oldClrType: typeof(int), |
|||
oldType: "int", |
|||
oldDefaultValue: -1); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<int>( |
|||
name: "Status", |
|||
table: "AppPlatformSmsMessages", |
|||
type: "int", |
|||
nullable: false, |
|||
defaultValue: -1, |
|||
oldClrType: typeof(int), |
|||
oldType: "int"); |
|||
|
|||
migrationBuilder.AlterColumn<int>( |
|||
name: "Status", |
|||
table: "AppPlatformEmailMessages", |
|||
type: "int", |
|||
nullable: false, |
|||
defaultValue: -1, |
|||
oldClrType: typeof(int), |
|||
oldType: "int"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,24 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks> |
|||
<AssemblyName>LINGYUN.Abp.Emailing.Platform</AssemblyName> |
|||
<PackageId>LINGYUN.Abp.Emailing.Platform</PackageId> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Emailing" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\LINGYUN.Platform.HttpApi.Client\LINGYUN.Platform.HttpApi.Client.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using LINGYUN.Platform.HttpApi.Client; |
|||
using Volo.Abp.Emailing; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.Emailing.Platform; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpEmailingModule), |
|||
typeof(PlatformHttpApiClientModule))] |
|||
public class AbpEmailingPlatformModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,130 @@ |
|||
using LINGYUN.Platform.Messages; |
|||
using LINGYUN.Platform.Messages.Integration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Net.Mail; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Content; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Emailing; |
|||
|
|||
namespace LINGYUN.Abp.Emailing.Platform; |
|||
|
|||
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] |
|||
public class PlatformEmailSender : IEmailSender |
|||
{ |
|||
private readonly IEmailMessageIntegrationService _service; |
|||
public PlatformEmailSender(IEmailMessageIntegrationService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual Task QueueAsync(string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) |
|||
{ |
|||
return SendAsync(from: null, to, subject, body, isBodyHtml, additionalEmailSendingArgs); |
|||
} |
|||
|
|||
public virtual Task QueueAsync(string from, string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) |
|||
{ |
|||
return SendAsync(from, to, subject, body, isBodyHtml, additionalEmailSendingArgs); |
|||
} |
|||
|
|||
public virtual Task SendAsync(string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) |
|||
{ |
|||
return SendAsync(from: null, to, subject, body, isBodyHtml, additionalEmailSendingArgs); |
|||
} |
|||
|
|||
public async virtual Task SendAsync(string from, string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) |
|||
{ |
|||
var createInput = new EmailMessageCreateDto( |
|||
to, |
|||
body, |
|||
from, |
|||
subject, |
|||
isBodyHtml, |
|||
additionalEmailSendingArgs?.CC?.JoinAsString(",")) |
|||
{ |
|||
Normalize = true |
|||
}; |
|||
|
|||
if (additionalEmailSendingArgs?.Attachments != null) |
|||
{ |
|||
var attachments = new List<IRemoteStreamContent>(); |
|||
|
|||
foreach (var attachment in additionalEmailSendingArgs.Attachments) |
|||
{ |
|||
var stream = new MemoryStream(attachment.File.Length); |
|||
|
|||
await stream.WriteAsync(attachment.File, 0, attachment.File.Length); |
|||
|
|||
stream.Seek(0, SeekOrigin.Begin); |
|||
|
|||
attachments.Add(new RemoteStreamContent(stream, attachment.Name)); |
|||
} |
|||
|
|||
createInput.Attachments = attachments.ToArray(); |
|||
} |
|||
if (additionalEmailSendingArgs?.ExtraProperties != null) |
|||
{ |
|||
createInput.ExtraProperties = new ExtraPropertyDictionary(); |
|||
foreach (var prop in additionalEmailSendingArgs.ExtraProperties) |
|||
{ |
|||
createInput.ExtraProperties.Add(prop.Key, prop.Value); |
|||
} |
|||
} |
|||
|
|||
await _service.CreateAsync(createInput); |
|||
} |
|||
|
|||
public async virtual Task SendAsync(MailMessage mail, bool normalize = true) |
|||
{ |
|||
var createInput = new EmailMessageCreateDto( |
|||
mail.To.ToString(), |
|||
mail.Body, |
|||
mail.From?.ToString(), |
|||
mail.Subject, |
|||
mail.IsBodyHtml, |
|||
mail.CC?.ToString()) |
|||
{ |
|||
Normalize = normalize, |
|||
Priority = mail.Priority, |
|||
BodyTransferEncoding = mail.BodyTransferEncoding, |
|||
DeliveryNotificationOptions = mail.DeliveryNotificationOptions |
|||
}; |
|||
|
|||
if (mail.Attachments != null) |
|||
{ |
|||
var attachments = new List<IRemoteStreamContent>(); |
|||
|
|||
foreach (var attachment in mail.Attachments) |
|||
{ |
|||
attachments.Add( |
|||
new RemoteStreamContent( |
|||
attachment.ContentStream, |
|||
attachment.Name, |
|||
attachment.ContentType?.ToString())); |
|||
} |
|||
|
|||
createInput.Attachments = attachments.ToArray(); |
|||
} |
|||
|
|||
if (mail.Headers != null) |
|||
{ |
|||
var headers = new List<EmailMessageHeaderDto>(); |
|||
foreach (var key in mail.Headers.AllKeys) |
|||
{ |
|||
var value = mail.Headers.Get(key); |
|||
if (!value.IsNullOrWhiteSpace()) |
|||
{ |
|||
headers.Add(new EmailMessageHeaderDto(key, value)); |
|||
} |
|||
} |
|||
createInput.Headers = headers; |
|||
} |
|||
|
|||
await _service.CreateAsync(createInput); |
|||
} |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
# LINGYUN.Abp.Emailing.Platform |
|||
|
|||
abp框架邮件发送接口**IEmailSender**的消息处理平台实现 |
|||
|
|||
通过平台服务接口实现邮件消息管理,发送,查询等功能 |
|||
|
|||
## 配置使用 |
|||
|
|||
模块按需引用 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpEmailingPlatformModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
## 配置项说明 |
|||
|
|||
```json |
|||
|
|||
{ |
|||
"RemoteServices": { |
|||
"Platform": { |
|||
"BaseUrl": "http://127.0.0.1:30025", |
|||
"IdentityClient": "InternalServiceClient", |
|||
"UseCurrentAccessToken": "False" |
|||
} |
|||
}, |
|||
"IdentityClients": { |
|||
"InternalServiceClient": { |
|||
"Authority": "http://127.0.0.1:44385", |
|||
"ClientId": "InternalServiceClient", |
|||
"ClientSecret": "1q2w3e*", |
|||
"GrantType": "client_credentials", |
|||
"RequireHttps": "False", |
|||
"Scope": "lingyun-abp-application" |
|||
} |
|||
}, |
|||
} |
|||
|
|||
``` |
|||
|
|||
## 相关链接 |
|||
|
|||
* [平台服务模块](../README.md) |
|||
* [邮件发送集成](https://abp.io/docs/latest/framework/infrastructure/emailing) |
|||
* [动态接口代理](https://abp.io/docs/latest/framework/api-development/dynamic-csharp-clients) |
|||
|
|||
## 其他 |
|||
|
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,24 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks> |
|||
<AssemblyName>LINGYUN.Abp.Sms.Platform</AssemblyName> |
|||
<PackageId>LINGYUN.Abp.Sms.Platform</PackageId> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Sms" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\LINGYUN.Platform.HttpApi.Client\LINGYUN.Platform.HttpApi.Client.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using LINGYUN.Platform.HttpApi.Client; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Sms; |
|||
|
|||
namespace LINGYUN.Abp.Sms.Platform; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpSmsModule), |
|||
typeof(PlatformHttpApiClientModule))] |
|||
public class AbpSmsPlatformModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
using LINGYUN.Platform.Messages; |
|||
using LINGYUN.Platform.Messages.Integration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Sms; |
|||
|
|||
namespace LINGYUN.Abp.Sms.Platform; |
|||
|
|||
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] |
|||
public class PlatformSmsSender : ISmsSender |
|||
{ |
|||
private readonly ISmsMessageIntegrationService _service; |
|||
public PlatformSmsSender(ISmsMessageIntegrationService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public async virtual Task SendAsync(SmsMessage smsMessage) |
|||
{ |
|||
var createInput = new SmsMessageCreateDto( |
|||
smsMessage.PhoneNumber, |
|||
smsMessage.Text); |
|||
|
|||
if (smsMessage.Properties != null) |
|||
{ |
|||
createInput.ExtraProperties = new ExtraPropertyDictionary(); |
|||
foreach (var property in smsMessage.Properties) |
|||
{ |
|||
createInput.ExtraProperties[property.Key] = property.Value; |
|||
} |
|||
} |
|||
|
|||
await _service.CreateAsync(createInput); |
|||
} |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
# LINGYUN.Abp.Sms.Platform |
|||
|
|||
abp框架短信发送接口**ISmsSender**的消息处理平台实现 |
|||
|
|||
通过平台服务接口实现短信消息管理,发送,查询等功能 |
|||
|
|||
## 配置使用 |
|||
|
|||
模块按需引用 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpSmsPlatformModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
## 配置项说明 |
|||
|
|||
```json |
|||
|
|||
{ |
|||
"RemoteServices": { |
|||
"Platform": { |
|||
"BaseUrl": "http://127.0.0.1:30025", |
|||
"IdentityClient": "InternalServiceClient", |
|||
"UseCurrentAccessToken": "False" |
|||
} |
|||
}, |
|||
"IdentityClients": { |
|||
"InternalServiceClient": { |
|||
"Authority": "http://127.0.0.1:44385", |
|||
"ClientId": "InternalServiceClient", |
|||
"ClientSecret": "1q2w3e*", |
|||
"GrantType": "client_credentials", |
|||
"RequireHttps": "False", |
|||
"Scope": "lingyun-abp-application" |
|||
} |
|||
}, |
|||
} |
|||
|
|||
``` |
|||
|
|||
## 相关链接 |
|||
|
|||
* [平台服务模块](../README.md) |
|||
* [短信发送集成](https://abp.io/docs/latest/framework/infrastructure/sms-sending) |
|||
* [动态接口代理](https://abp.io/docs/latest/framework/api-development/dynamic-csharp-clients) |
|||
|
|||
## 其他 |
|||
|
|||
@ -0,0 +1,16 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessageAttachmentDto |
|||
{ |
|||
[Required] |
|||
[DynamicStringLength(typeof(EmailMessageAttachmentConsts), nameof(EmailMessageAttachmentConsts.MaxNameLength))] |
|||
public string Name { get; set; } |
|||
|
|||
[Required] |
|||
[DynamicStringLength(typeof(EmailMessageAttachmentConsts), nameof(EmailMessageAttachmentConsts.MaxNameLength))] |
|||
public string BlobName { get; set; } |
|||
|
|||
public long Size { get; set; } |
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
using JetBrains.Annotations; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Net.Mail; |
|||
using System.Net.Mime; |
|||
using Volo.Abp.Auditing; |
|||
using Volo.Abp.Content; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessageCreateDto : IHasExtraProperties |
|||
{ |
|||
[Required] |
|||
[DynamicStringLength(typeof(MessageConsts), nameof(MessageConsts.MaxReceiverLength))] |
|||
public string To { get; set; } |
|||
|
|||
[Required] |
|||
public string Content { get; set; } |
|||
|
|||
[DynamicStringLength(typeof(EmailMessageConsts), nameof(EmailMessageConsts.MaxFromLength))] |
|||
public string From { get; set; } |
|||
|
|||
[DynamicStringLength(typeof(EmailMessageConsts), nameof(EmailMessageConsts.MaxSubjectLength))] |
|||
public string Subject { get; set; } |
|||
|
|||
public bool IsBodyHtml { get; set; } = true; |
|||
|
|||
[DynamicStringLength(typeof(MessageConsts), nameof(MessageConsts.MaxReceiverLength))] |
|||
public string CC { get; set; } |
|||
|
|||
public bool Normalize { get; set; } |
|||
|
|||
public MailPriority? Priority { get; set; } |
|||
public TransferEncoding? BodyTransferEncoding { get; set; } |
|||
public DeliveryNotificationOptions? DeliveryNotificationOptions { get; set; } |
|||
|
|||
[DisableAuditing] |
|||
public IRemoteStreamContent[] Attachments { get; set; } |
|||
|
|||
public List<EmailMessageHeaderDto> Headers { get; set; } |
|||
public ExtraPropertyDictionary ExtraProperties { get; set; } |
|||
|
|||
public EmailMessageCreateDto() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public EmailMessageCreateDto( |
|||
[NotNull] string to, |
|||
[NotNull] string content, |
|||
string from = null, |
|||
string subject = null, |
|||
bool isBodyHtml = true, |
|||
string cc = null) |
|||
{ |
|||
To = to; |
|||
Content = content; |
|||
From = from; |
|||
Subject = subject; |
|||
IsBodyHtml = isBodyHtml; |
|||
CC = cc; |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.Collections.Generic; |
|||
using System.Net.Mail; |
|||
using System.Net.Mime; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
public class EmailMessageDto : MessageDto |
|||
{ |
|||
public string From { get; set; } |
|||
public string Subject { get; set; } |
|||
public bool IsBodyHtml { get; set; } |
|||
public string CC { get; set; } |
|||
public bool Normalize { get; set; } |
|||
public MailPriority? Priority { get; set; } |
|||
public TransferEncoding? BodyTransferEncoding { get; set; } |
|||
public DeliveryNotificationOptions? DeliveryNotificationOptions { get; set; } |
|||
public ICollection<EmailMessageAttachmentDto> Attachments { get; set; } |
|||
public List<EmailMessageHeaderDto> Headers { get; set; } |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using System.Net.Mail; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessageGetListInput : PagedAndSortedResultRequestDto |
|||
{ |
|||
public string EmailAddress { get; set; } |
|||
public string Content { get; set; } |
|||
public string From { get; set; } |
|||
public string Subject { get; set; } |
|||
public MessageStatus? Status { get; set; } |
|||
public MailPriority? Priority { get; set; } |
|||
public DateTime? BeginSendTime { get; set; } |
|||
public DateTime? EndSendTime { get; set; } |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using JetBrains.Annotations; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessageHeaderDto |
|||
{ |
|||
[Required] |
|||
[DynamicStringLength(typeof(EmailMessageHeaderConsts), nameof(EmailMessageHeaderConsts.MaxKeyLength))] |
|||
public string Key { get; set; } |
|||
|
|||
[Required] |
|||
[DynamicStringLength(typeof(EmailMessageHeaderConsts), nameof(EmailMessageHeaderConsts.MaxValueLength))] |
|||
public string Value { get; set; } |
|||
public EmailMessageHeaderDto() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public EmailMessageHeaderDto( |
|||
[NotNull] string key, |
|||
[NotNull] string value) |
|||
{ |
|||
Key = key; |
|||
Value = value; |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public abstract class MessageDto : AuditedEntityDto<Guid> |
|||
{ |
|||
public Guid? UserId { get; set; } |
|||
public string Sender { get; set; } |
|||
public string Provider { get; set; } |
|||
public string Receiver { get; set; } |
|||
public string Content { get; set; } |
|||
public DateTime? SendTime { get; set; } |
|||
public int SendCount { get; set; } |
|||
public MessageStatus Status { get; set; } |
|||
public string Reason { get; set; } |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using JetBrains.Annotations; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class SmsMessageCreateDto : IHasExtraProperties |
|||
{ |
|||
[Required] |
|||
[DynamicStringLength(typeof(MessageConsts), nameof(MessageConsts.MaxReceiverLength))] |
|||
public string PhoneNumber { get; set; } |
|||
|
|||
[Required] |
|||
public string Text { get; set; } |
|||
|
|||
public ExtraPropertyDictionary ExtraProperties { get; set; } |
|||
|
|||
public SmsMessageCreateDto() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public SmsMessageCreateDto( |
|||
[NotNull] string phoneNumber, |
|||
[NotNull] string text) |
|||
{ |
|||
PhoneNumber = phoneNumber; |
|||
Text = text; |
|||
} |
|||
} |
|||
@ -0,0 +1,5 @@ |
|||
namespace LINGYUN.Platform.Messages; |
|||
public class SmsMessageDto : MessageDto |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class SmsMessageGetListInput : PagedAndSortedResultRequestDto |
|||
{ |
|||
public string PhoneNumber { get; set; } |
|||
public string Content { get; set; } |
|||
public MessageStatus? Status { get; set; } |
|||
public DateTime? BeginSendTime { get; set; } |
|||
public DateTime? EndSendTime { get; set; } |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public interface IEmailMessageAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 获取邮件消息
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
Task<EmailMessageDto> GetAsync(Guid id); |
|||
/// <summary>
|
|||
/// 删除邮件消息
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
Task DeleteAsync(Guid id); |
|||
/// <summary>
|
|||
/// 发送邮件消息
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
Task SendAsync(Guid id); |
|||
/// <summary>
|
|||
/// 获取邮件消息列表
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<PagedResultDto<EmailMessageDto>> GetListAsync(EmailMessageGetListInput input); |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public interface ISmsMessageAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 获取短信消息
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
Task<SmsMessageDto> GetAsync(Guid id); |
|||
/// <summary>
|
|||
/// 删除短信消息
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
Task DeleteAsync(Guid id); |
|||
/// <summary>
|
|||
/// 重新发送短信消息
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
Task SendAsync(Guid id); |
|||
/// <summary>
|
|||
/// 获取短信消息列表
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<PagedResultDto<SmsMessageDto>> GetListAsync(SmsMessageGetListInput input); |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
|
|||
[IntegrationService] |
|||
public interface IEmailMessageIntegrationService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 创建邮件消息
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<EmailMessageDto> CreateAsync(EmailMessageCreateDto input); |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
|
|||
[IntegrationService] |
|||
public interface ISmsMessageIntegrationService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 创建短信消息
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<SmsMessageDto> CreateAsync(SmsMessageCreateDto input); |
|||
} |
|||
@ -1,120 +1,138 @@ |
|||
using Volo.Abp.Reflection; |
|||
|
|||
namespace LINGYUN.Platform.Permissions; |
|||
|
|||
public static class PlatformPermissions |
|||
{ |
|||
public const string GroupName = "Platform"; |
|||
|
|||
public class DataDictionary |
|||
{ |
|||
public const string Default = GroupName + ".DataDictionary"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Move = Default + ".Move"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string ManageItems = Default + ".ManageItems"; |
|||
} |
|||
|
|||
public class Layout |
|||
{ |
|||
public const string Default = GroupName + ".Layout"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
} |
|||
|
|||
public class Menu |
|||
{ |
|||
public const string Default = GroupName + ".Menu"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string ManageRoles = Default + ".ManageRoles"; |
|||
|
|||
using Volo.Abp.Reflection; |
|||
|
|||
namespace LINGYUN.Platform.Permissions; |
|||
|
|||
public static class PlatformPermissions |
|||
{ |
|||
public const string GroupName = "Platform"; |
|||
|
|||
public class DataDictionary |
|||
{ |
|||
public const string Default = GroupName + ".DataDictionary"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Move = Default + ".Move"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string ManageItems = Default + ".ManageItems"; |
|||
} |
|||
|
|||
public class Layout |
|||
{ |
|||
public const string Default = GroupName + ".Layout"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
} |
|||
|
|||
public class Menu |
|||
{ |
|||
public const string Default = GroupName + ".Menu"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string ManageRoles = Default + ".ManageRoles"; |
|||
|
|||
public const string ManageUsers = Default + ".ManageUsers"; |
|||
|
|||
public const string ManageUserFavorites = Default + ".ManageUserFavorites"; |
|||
} |
|||
|
|||
// 如果abp后期提供对象存储的目录管理接口,则启用此权限
|
|||
/// <summary>
|
|||
/// 文件系统
|
|||
/// </summary>
|
|||
public class FileSystem |
|||
{ |
|||
public const string Default = GroupName + ".FileSystem"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string Rename = Default + ".Rename"; |
|||
|
|||
public const string Copy = Default + ".Copy"; |
|||
|
|||
public const string Move = Default + ".Move"; |
|||
|
|||
public class FileManager |
|||
{ |
|||
public const string Default = FileSystem.Default + ".FileManager"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Copy = Default + ".Copy"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Move = Default + ".Move"; |
|||
|
|||
public const string Download = Default + ".Download"; |
|||
} |
|||
} |
|||
|
|||
public class Package |
|||
{ |
|||
public const string Default = GroupName + ".Package"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string ManageBlobs = Default + ".ManageBlobs"; |
|||
} |
|||
|
|||
public const string ManageUserFavorites = Default + ".ManageUserFavorites"; |
|||
} |
|||
|
|||
// 如果abp后期提供对象存储的目录管理接口,则启用此权限
|
|||
/// <summary>
|
|||
/// 文件系统
|
|||
/// </summary>
|
|||
public class FileSystem |
|||
{ |
|||
public const string Default = GroupName + ".FileSystem"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string Rename = Default + ".Rename"; |
|||
|
|||
public const string Copy = Default + ".Copy"; |
|||
|
|||
public const string Move = Default + ".Move"; |
|||
|
|||
public class FileManager |
|||
{ |
|||
public const string Default = FileSystem.Default + ".FileManager"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Copy = Default + ".Copy"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Move = Default + ".Move"; |
|||
|
|||
public const string Download = Default + ".Download"; |
|||
} |
|||
} |
|||
|
|||
public class Package |
|||
{ |
|||
public const string Default = GroupName + ".Package"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string ManageBlobs = Default + ".ManageBlobs"; |
|||
} |
|||
|
|||
public class Feedback |
|||
{ |
|||
public const string Default = GroupName + ".Feedback"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
{ |
|||
public const string Default = GroupName + ".Feedback"; |
|||
|
|||
public const string Create = Default + ".Create"; |
|||
|
|||
public const string Update = Default + ".Update"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string ManageComments = Default + ".ManageComments"; |
|||
|
|||
public const string ManageAttachments = Default + ".ManageAttachments"; |
|||
} |
|||
|
|||
public static string[] GetAll() |
|||
{ |
|||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(PlatformPermissions)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
public class EmailMessage |
|||
{ |
|||
public const string Default = GroupName + ".EmailMessage"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string SendMessage = Default + ".SendMessage"; |
|||
} |
|||
|
|||
public class SmsMessage |
|||
{ |
|||
public const string Default = GroupName + ".SmsMessage"; |
|||
|
|||
public const string Delete = Default + ".Delete"; |
|||
|
|||
public const string SendMessage = Default + ".SendMessage"; |
|||
} |
|||
|
|||
public static string[] GetAll() |
|||
{ |
|||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(PlatformPermissions)); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,94 @@ |
|||
using LINGYUN.Platform.Permissions; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq.Expressions; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
[Authorize(PlatformPermissions.EmailMessage.Default)] |
|||
public class EmailMessageAppService : PlatformApplicationServiceBase, IEmailMessageAppService |
|||
{ |
|||
private readonly IEmailMessageManager _emailMessageManager; |
|||
private readonly IEmailMessageRepository _emailMessageRepository; |
|||
|
|||
public EmailMessageAppService( |
|||
IEmailMessageManager emailMessageManager, |
|||
IEmailMessageRepository emailMessageRepository) |
|||
{ |
|||
_emailMessageManager = emailMessageManager; |
|||
_emailMessageRepository = emailMessageRepository; |
|||
} |
|||
|
|||
[Authorize(PlatformPermissions.EmailMessage.Delete)] |
|||
public async virtual Task DeleteAsync(Guid id) |
|||
{ |
|||
var emailMessage = await _emailMessageRepository.GetAsync(id); |
|||
|
|||
await _emailMessageRepository.DeleteAsync(emailMessage); |
|||
|
|||
await CurrentUnitOfWork.SaveChangesAsync(); |
|||
} |
|||
|
|||
public async virtual Task<EmailMessageDto> GetAsync(Guid id) |
|||
{ |
|||
var emailMessage = await _emailMessageRepository.GetAsync(id); |
|||
|
|||
return ObjectMapper.Map<EmailMessage, EmailMessageDto>(emailMessage); |
|||
} |
|||
|
|||
public async virtual Task<PagedResultDto<EmailMessageDto>> GetListAsync(EmailMessageGetListInput input) |
|||
{ |
|||
var specification = new EmailMessageGetListSpecification(input); |
|||
|
|||
var totalCount = await _emailMessageRepository.GetCountAsync(specification); |
|||
var emailMessages = await _emailMessageRepository.GetListAsync( |
|||
specification, |
|||
input.Sorting, |
|||
input.MaxResultCount, |
|||
input.SkipCount |
|||
); |
|||
|
|||
return new PagedResultDto<EmailMessageDto>(totalCount, |
|||
ObjectMapper.Map<List<EmailMessage>, List<EmailMessageDto>>(emailMessages) |
|||
); |
|||
} |
|||
|
|||
[Authorize(PlatformPermissions.EmailMessage.SendMessage)] |
|||
public async virtual Task SendAsync(Guid id) |
|||
{ |
|||
var emailMessage = await _emailMessageRepository.GetAsync(id); |
|||
|
|||
await _emailMessageManager.SendAsync(emailMessage); |
|||
|
|||
await _emailMessageRepository.UpdateAsync(emailMessage); |
|||
|
|||
await CurrentUnitOfWork.SaveChangesAsync(); |
|||
} |
|||
|
|||
private class EmailMessageGetListSpecification : Volo.Abp.Specifications.Specification<EmailMessage> |
|||
{ |
|||
protected EmailMessageGetListInput Input { get; } |
|||
public EmailMessageGetListSpecification(EmailMessageGetListInput input) |
|||
{ |
|||
Input = input; |
|||
} |
|||
|
|||
public override Expression<Func<EmailMessage, bool>> ToExpression() |
|||
{ |
|||
Expression<Func<EmailMessage, bool>> expression = _ => true; |
|||
|
|||
return expression |
|||
.AndIf(!Input.EmailAddress.IsNullOrWhiteSpace(), x => x.Receiver.Contains(Input.EmailAddress)) |
|||
.AndIf(!Input.Subject.IsNullOrWhiteSpace(), x => x.Subject.Contains(Input.Subject)) |
|||
.AndIf(!Input.Content.IsNullOrWhiteSpace(), x => x.Content.Contains(Input.Content)) |
|||
.AndIf(!Input.From.IsNullOrWhiteSpace(), x => x.From.Contains(Input.From)) |
|||
.AndIf(Input.Status.HasValue, x => x.Status == Input.Status) |
|||
.AndIf(Input.Priority.HasValue, x => x.Priority == Input.Priority) |
|||
.AndIf(Input.BeginSendTime.HasValue, x => x.SendTime >= Input.BeginSendTime) |
|||
.AndIf(Input.EndSendTime.HasValue, x => x.SendTime <= Input.EndSendTime); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.BlobStoring; |
|||
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
|
|||
public class EmailMessageIntegrationService : PlatformApplicationServiceBase, IEmailMessageIntegrationService |
|||
{ |
|||
private readonly IBlobContainer<MessagingContainer> _blobContainer; |
|||
private readonly IEmailMessageRepository _emailMessageRepository; |
|||
|
|||
public EmailMessageIntegrationService( |
|||
IBlobContainer<MessagingContainer> blobContainer, |
|||
IEmailMessageRepository emailMessageRepository) |
|||
{ |
|||
_blobContainer = blobContainer; |
|||
_emailMessageRepository = emailMessageRepository; |
|||
} |
|||
|
|||
public async virtual Task<EmailMessageDto> CreateAsync(EmailMessageCreateDto input) |
|||
{ |
|||
var emailMessage = new EmailMessage( |
|||
GuidGenerator.Create(), |
|||
input.To, |
|||
input.From, |
|||
input.Subject, |
|||
input.Content, |
|||
input.IsBodyHtml, |
|||
input.CC, |
|||
CurrentUser.Id, |
|||
CurrentUser.UserName) |
|||
{ |
|||
Normalize = input.Normalize, |
|||
Priority = input.Priority, |
|||
BodyTransferEncoding = input.BodyTransferEncoding, |
|||
DeliveryNotificationOptions = input.DeliveryNotificationOptions |
|||
}; |
|||
if (input.Headers != null) |
|||
{ |
|||
foreach (var header in input.Headers) |
|||
{ |
|||
emailMessage.AddHeader(header.Key, header.Value); |
|||
} |
|||
} |
|||
if (input.Attachments != null) |
|||
{ |
|||
foreach (var attachment in input.Attachments) |
|||
{ |
|||
var attachmentStream = attachment.GetStream(); |
|||
|
|||
var attachmentNamePrefix = $"attachments/{Clock.Now:yyyy-MM-dd}"; |
|||
var attachmentName = $"{attachmentNamePrefix}/{emailMessage.Id}/{attachment.FileName}"; |
|||
|
|||
await _blobContainer.SaveAsync(attachmentName, attachmentStream, overrideExisting: true); |
|||
|
|||
emailMessage.AddAttachment(attachment.FileName, attachmentName, attachmentStream.Length); |
|||
} |
|||
} |
|||
|
|||
emailMessage = await _emailMessageRepository.InsertAsync(emailMessage); |
|||
|
|||
await CurrentUnitOfWork.SaveChangesAsync(); |
|||
|
|||
return ObjectMapper.Map<EmailMessage, EmailMessageDto>(emailMessage); |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
public class SmsMessageIntegrationService : PlatformApplicationServiceBase, ISmsMessageIntegrationService |
|||
{ |
|||
private readonly ISmsMessageRepository _smsMessageRepository; |
|||
|
|||
public SmsMessageIntegrationService(ISmsMessageRepository smsMessageRepository) |
|||
{ |
|||
_smsMessageRepository = smsMessageRepository; |
|||
} |
|||
|
|||
|
|||
public async virtual Task<SmsMessageDto> CreateAsync(SmsMessageCreateDto input) |
|||
{ |
|||
var smsMessage = new SmsMessage( |
|||
GuidGenerator.Create(), |
|||
input.PhoneNumber, |
|||
input.Text, |
|||
CurrentUser.Id, |
|||
CurrentUser.UserName |
|||
); |
|||
if (input.ExtraProperties != null) |
|||
{ |
|||
foreach (var prop in input.ExtraProperties) |
|||
{ |
|||
smsMessage.SetProperty(prop.Key, prop.Value); |
|||
} |
|||
} |
|||
|
|||
smsMessage = await _smsMessageRepository.InsertAsync(smsMessage); |
|||
|
|||
await CurrentUnitOfWork.SaveChangesAsync(); |
|||
|
|||
return ObjectMapper.Map<SmsMessage, SmsMessageDto>(smsMessage); |
|||
} |
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
using LINGYUN.Platform.Permissions; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq.Expressions; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
[Authorize(PlatformPermissions.SmsMessage.Default)] |
|||
public class SmsMessageAppService : PlatformApplicationServiceBase, ISmsMessageAppService |
|||
{ |
|||
private readonly ISmsMessageManager _smsMessageManager; |
|||
private readonly ISmsMessageRepository _smsMessageRepository; |
|||
|
|||
public SmsMessageAppService( |
|||
ISmsMessageManager smsMessageManager, |
|||
ISmsMessageRepository smsMessageRepository) |
|||
{ |
|||
_smsMessageManager = smsMessageManager; |
|||
_smsMessageRepository = smsMessageRepository; |
|||
} |
|||
|
|||
[Authorize(PlatformPermissions.SmsMessage.Delete)] |
|||
public async virtual Task DeleteAsync(Guid id) |
|||
{ |
|||
var smsMessage = await _smsMessageRepository.GetAsync(id); |
|||
|
|||
await _smsMessageRepository.DeleteAsync(smsMessage); |
|||
|
|||
await CurrentUnitOfWork.SaveChangesAsync(); |
|||
} |
|||
|
|||
public async virtual Task<SmsMessageDto> GetAsync(Guid id) |
|||
{ |
|||
var smsMessage = await _smsMessageRepository.GetAsync(id); |
|||
|
|||
return ObjectMapper.Map<SmsMessage, SmsMessageDto>(smsMessage); |
|||
} |
|||
|
|||
public async virtual Task<PagedResultDto<SmsMessageDto>> GetListAsync(SmsMessageGetListInput input) |
|||
{ |
|||
var specification = new SmsMessageGetListSpecification(input); |
|||
|
|||
var totalCount = await _smsMessageRepository.GetCountAsync(specification); |
|||
var smsMessages = await _smsMessageRepository.GetListAsync( |
|||
specification, |
|||
input.Sorting, |
|||
input.MaxResultCount, |
|||
input.SkipCount |
|||
); |
|||
|
|||
return new PagedResultDto<SmsMessageDto>(totalCount, |
|||
ObjectMapper.Map<List<SmsMessage>, List<SmsMessageDto>>(smsMessages) |
|||
); |
|||
} |
|||
|
|||
[Authorize(PlatformPermissions.SmsMessage.SendMessage)] |
|||
public async virtual Task SendAsync(Guid id) |
|||
{ |
|||
var smsMessage = await _smsMessageRepository.GetAsync(id); |
|||
|
|||
await _smsMessageManager.SendAsync(smsMessage); |
|||
|
|||
await _smsMessageRepository.UpdateAsync(smsMessage); |
|||
|
|||
await CurrentUnitOfWork.SaveChangesAsync(); |
|||
} |
|||
|
|||
private class SmsMessageGetListSpecification : Volo.Abp.Specifications.Specification<SmsMessage> |
|||
{ |
|||
protected SmsMessageGetListInput Input { get; } |
|||
public SmsMessageGetListSpecification(SmsMessageGetListInput input) |
|||
{ |
|||
Input = input; |
|||
} |
|||
|
|||
public override Expression<Func<SmsMessage, bool>> ToExpression() |
|||
{ |
|||
Expression<Func<SmsMessage, bool>> expression = _ => true; |
|||
|
|||
return expression |
|||
.AndIf(!Input.PhoneNumber.IsNullOrWhiteSpace(), x => x.Receiver.Contains(Input.PhoneNumber)) |
|||
.AndIf(!Input.Content.IsNullOrWhiteSpace(), x => x.Content.Contains(Input.Content)) |
|||
.AndIf(Input.Status.HasValue, x => x.Status == Input.Status) |
|||
.AndIf(Input.BeginSendTime.HasValue, x => x.SendTime >= Input.BeginSendTime) |
|||
.AndIf(Input.EndSendTime.HasValue, x => x.SendTime <= Input.EndSendTime); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,5 @@ |
|||
namespace LINGYUN.Platform.Messages; |
|||
public static class EmailMessageAttachmentConsts |
|||
{ |
|||
public static int MaxNameLength { get; set; } = 256; |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace LINGYUN.Platform.Messages; |
|||
public static class EmailMessageConsts |
|||
{ |
|||
public static int MaxFromLength { get; set; } = 128; |
|||
public static int MaxSubjectLength { get; set; } = 128; |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using Volo.Abp.EventBus; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
[EventName("platform.messages.email")] |
|||
public class EmailMessageEto : MessageEto |
|||
{ |
|||
public string From { get; set; } |
|||
public string Subject { get; set; } |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace LINGYUN.Platform.Messages; |
|||
public static class EmailMessageHeaderConsts |
|||
{ |
|||
public static int MaxKeyLength { get; set; } = 64; |
|||
public static int MaxValueLength { get; set; } = 128; |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
namespace LINGYUN.Platform.Messages; |
|||
public static class MessageConsts |
|||
{ |
|||
public static int MaxSenderLength { get; set; } = 256; |
|||
public static int MaxReceiverLength { get; set; } = 1024; |
|||
public static int MaxProviderLength { get; set; } = 128; |
|||
public static int MaxReasonLength { get; set; } = 256; |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public abstract class MessageEto |
|||
{ |
|||
public Guid Id { get; set; } |
|||
public Guid? UserId { get; set; } |
|||
public string Sender { get; set; } |
|||
public DateTime CreationTime { get; set; } |
|||
public Guid? CreatorId { get; set; } |
|||
public MessageStatus Status { get; set; } |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
namespace LINGYUN.Platform.Messages; |
|||
public enum MessageStatus |
|||
{ |
|||
/// <summary>
|
|||
/// 未发送
|
|||
/// </summary>
|
|||
Pending = -1, |
|||
/// <summary>
|
|||
/// 已发送
|
|||
/// </summary>
|
|||
Sent = 0, |
|||
/// <summary>
|
|||
/// 发送失败
|
|||
/// </summary>
|
|||
Failed = 10 |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.EventBus; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
[EventName("platform.messages.sms")] |
|||
public class SmsMessageEto : MessageEto |
|||
{ |
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Linq; |
|||
using System.Net.Mail; |
|||
using System.Net.Mime; |
|||
using Volo.Abp; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessage : Message |
|||
{ |
|||
public virtual string From { get; set; } |
|||
public virtual string Subject { get; private set; } |
|||
public virtual bool IsBodyHtml { get; private set; } |
|||
public virtual string CC { get; private set; } |
|||
public virtual bool Normalize { get; set; } |
|||
public virtual MailPriority? Priority { get; set; } |
|||
public virtual TransferEncoding? BodyTransferEncoding { get; set; } |
|||
public virtual DeliveryNotificationOptions? DeliveryNotificationOptions { get; set; } |
|||
public virtual ICollection<EmailMessageAttachment> Attachments { get; private set; } |
|||
public virtual ICollection<EmailMessageHeader> Headers { get; private set; } |
|||
protected EmailMessage() |
|||
{ |
|||
Headers = new Collection<EmailMessageHeader>(); |
|||
Attachments = new Collection<EmailMessageAttachment>(); |
|||
} |
|||
public EmailMessage( |
|||
Guid id, |
|||
string to, |
|||
string from, |
|||
string subject, |
|||
string body, |
|||
bool isBodyHtml = false, |
|||
string cc = null, |
|||
Guid? userId = null, |
|||
string userName = null) |
|||
: base(id, to, body, userId, userName) |
|||
{ |
|||
From = Check.Length(from, nameof(from), EmailMessageConsts.MaxFromLength); |
|||
Subject = Check.Length(subject, nameof(subject), EmailMessageConsts.MaxSubjectLength); |
|||
IsBodyHtml = isBodyHtml; |
|||
CC = Check.Length(cc, nameof(cc), MessageConsts.MaxReceiverLength); |
|||
|
|||
Headers = new Collection<EmailMessageHeader>(); |
|||
Attachments = new Collection<EmailMessageAttachment>(); |
|||
} |
|||
|
|||
public bool IsInAttachment(string name) |
|||
{ |
|||
return Attachments.Any(x => x.Name == name); |
|||
} |
|||
|
|||
public void RemoveAttachment(string name) |
|||
{ |
|||
Attachments.RemoveAll(x => x.Name == name); |
|||
} |
|||
|
|||
public void AddAttachment(string name, string blobName, long size) |
|||
{ |
|||
if (IsInAttachment(name)) |
|||
{ |
|||
throw new BusinessException(PlatformErrorCodes.DuplicateEmailMessageAttachment) |
|||
.WithData("Name", name); |
|||
} |
|||
Attachments.Add(new EmailMessageAttachment(Id, name, blobName, size)); |
|||
} |
|||
|
|||
public bool IsInHeader(string key) |
|||
{ |
|||
return Headers.Any(x => x.Key == key); |
|||
} |
|||
|
|||
public void RemoveHeader(string key) |
|||
{ |
|||
Headers.RemoveAll(x => x.Key == key); |
|||
} |
|||
|
|||
public void AddHeader(string key, string value) |
|||
{ |
|||
if (IsInHeader(key)) |
|||
{ |
|||
throw new BusinessException(PlatformErrorCodes.DuplicateEmailMessageHeader) |
|||
.WithData("Key", key); |
|||
} |
|||
Headers.Add(new EmailMessageHeader(Id, key, value)); |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessageAttachment : Entity<long> |
|||
{ |
|||
public virtual Guid MessageId { get; private set; } |
|||
public virtual string Name { get; private set; } |
|||
public virtual string BlobName { get; private set; } |
|||
public virtual long Size { get; private set; } |
|||
protected EmailMessageAttachment() |
|||
{ |
|||
|
|||
} |
|||
public EmailMessageAttachment(Guid messageId, string name, string blobName, long size) |
|||
{ |
|||
MessageId = messageId; |
|||
Name = Check.NotNullOrWhiteSpace(name, nameof(name), EmailMessageAttachmentConsts.MaxNameLength); |
|||
BlobName = Check.NotNullOrWhiteSpace(blobName, nameof(blobName), EmailMessageAttachmentConsts.MaxNameLength); |
|||
Size = size; |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessageHeader : Entity<long> |
|||
{ |
|||
public virtual Guid MessageId { get; private set; } |
|||
public virtual string Key { get; private set; } |
|||
public virtual string Value { get; private set; } |
|||
protected EmailMessageHeader() |
|||
{ |
|||
} |
|||
public EmailMessageHeader(Guid messageId, string key, string value) |
|||
{ |
|||
MessageId = messageId; |
|||
Key = Check.NotNullOrWhiteSpace(key, nameof(key), EmailMessageHeaderConsts.MaxKeyLength); |
|||
Value = Check.NotNullOrWhiteSpace(value, nameof(value), EmailMessageHeaderConsts.MaxValueLength); |
|||
} |
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using System; |
|||
using System.IO; |
|||
using System.Net.Mail; |
|||
using System.Text.RegularExpressions; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.BlobStoring; |
|||
using Volo.Abp.Domain.Services; |
|||
using Volo.Abp.DynamicProxy; |
|||
using Volo.Abp.Emailing; |
|||
using Volo.Abp.Settings; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EmailMessageManager : DomainService, IEmailMessageManager |
|||
{ |
|||
private const string FromAddressPattern = @"([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})"; |
|||
|
|||
protected ISettingProvider SettingProvider { get; } |
|||
protected IEmailMessageRepository Repository { get; } |
|||
protected IBlobContainer<MessagingContainer> BlobContainer { get; } |
|||
|
|||
public EmailMessageManager( |
|||
ISettingProvider settingProvider, |
|||
IEmailMessageRepository repository, |
|||
IBlobContainer<MessagingContainer> blobContainer) |
|||
{ |
|||
SettingProvider = settingProvider; |
|||
Repository = repository; |
|||
BlobContainer = blobContainer; |
|||
} |
|||
|
|||
public async virtual Task<EmailMessage> SendAsync(EmailMessage message) |
|||
{ |
|||
var emailSender = GetEmailSender(); |
|||
|
|||
message.Provider = ProxyHelper.GetUnProxiedType(emailSender).Name; |
|||
|
|||
var error = await TrySendAsync(emailSender, message); |
|||
|
|||
if (error.IsNullOrWhiteSpace()) |
|||
{ |
|||
message.Sent(Clock); |
|||
} |
|||
else |
|||
{ |
|||
message.Failed(error, Clock); |
|||
} |
|||
|
|||
return message; |
|||
} |
|||
|
|||
public async virtual Task<string> TrySendAsync(IEmailSender emailSender, EmailMessage message) |
|||
{ |
|||
try |
|||
{ |
|||
MailAddress from; |
|||
if (message.From.IsNullOrWhiteSpace()) |
|||
{ |
|||
var defaultFrom = await SettingProvider.GetOrNullAsync(EmailSettingNames.DefaultFromAddress); |
|||
var defaultFromDisplayName = await SettingProvider.GetOrNullAsync(EmailSettingNames.DefaultFromDisplayName); |
|||
from = new MailAddress(defaultFrom, defaultFromDisplayName); |
|||
|
|||
message.From = $"{defaultFrom}{(defaultFromDisplayName.IsNullOrWhiteSpace() ? "" : $"<{defaultFromDisplayName}>")}"; |
|||
} |
|||
else |
|||
{ |
|||
var match = Regex.Match(message.From, FromAddressPattern); |
|||
if (match.Success) |
|||
{ |
|||
from = new MailAddress(match.Value); |
|||
} |
|||
else |
|||
{ |
|||
from = new MailAddress(message.From); |
|||
} |
|||
} |
|||
var to = new MailAddress(message.Receiver); |
|||
|
|||
var mailMessage = new MailMessage(from, to) |
|||
{ |
|||
Subject = message.Subject, |
|||
Body = message.Content, |
|||
IsBodyHtml = message.IsBodyHtml, |
|||
}; |
|||
|
|||
if (!message.CC.IsNullOrWhiteSpace()) |
|||
{ |
|||
mailMessage.CC.Add(message.CC); |
|||
} |
|||
|
|||
if (message.Priority.HasValue) |
|||
{ |
|||
mailMessage.Priority = message.Priority.Value; |
|||
} |
|||
if (message.BodyTransferEncoding.HasValue) |
|||
{ |
|||
mailMessage.BodyTransferEncoding = message.BodyTransferEncoding.Value; |
|||
} |
|||
if (message.DeliveryNotificationOptions.HasValue) |
|||
{ |
|||
mailMessage.DeliveryNotificationOptions = message.DeliveryNotificationOptions.Value; |
|||
} |
|||
|
|||
foreach (var header in message.Headers) |
|||
{ |
|||
mailMessage.Headers.Add(header.Key, header.Value); |
|||
} |
|||
|
|||
foreach (var attachment in message.Attachments) |
|||
{ |
|||
var blob = await BlobContainer.GetOrNullAsync(attachment.BlobName); |
|||
if (blob != null && blob != Stream.Null) |
|||
{ |
|||
mailMessage.Attachments.Add(new Attachment(blob, attachment.Name)); |
|||
} |
|||
} |
|||
|
|||
await emailSender.SendAsync(mailMessage, message.Normalize); |
|||
|
|||
return null; |
|||
} |
|||
catch(Exception ex) |
|||
{ |
|||
Logger.LogWarning("Failed to send a email message, error: {message}", ex.ToString()); |
|||
|
|||
return ex.Message; |
|||
} |
|||
} |
|||
|
|||
protected virtual IEmailSender GetEmailSender() |
|||
{ |
|||
return LazyServiceProvider.LazyGetRequiredService<IEmailSender>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public interface IEmailMessageManager |
|||
{ |
|||
Task<EmailMessage> SendAsync(EmailMessage message); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Specifications; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public interface IEmailMessageRepository : IBasicRepository<EmailMessage, Guid> |
|||
{ |
|||
Task<int> GetCountAsync( |
|||
ISpecification<EmailMessage> specification, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<List<EmailMessage>> GetListAsync( |
|||
ISpecification<EmailMessage> specification, |
|||
string sorting = $"{nameof(Message.CreationTime)} DESC", |
|||
int maxResultCount = 10, |
|||
int skipCount = 0, |
|||
CancellationToken cancellationToken = default); |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public interface ISmsMessageManager |
|||
{ |
|||
Task<SmsMessage> SendAsync(SmsMessage message); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Specifications; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public interface ISmsMessageRepository : IBasicRepository<SmsMessage, Guid> |
|||
{ |
|||
Task<int> GetCountAsync( |
|||
ISpecification<SmsMessage> specification, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<List<SmsMessage>> GetListAsync( |
|||
ISpecification<SmsMessage> specification, |
|||
string sorting = $"{nameof(Message.CreationTime)} DESC", |
|||
int maxResultCount = 10, |
|||
int skipCount = 0, |
|||
CancellationToken cancellationToken = default); |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.Timing; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
public class Message : AuditedAggregateRoot<Guid> |
|||
{ |
|||
public virtual Guid? UserId { get; private set; } |
|||
public virtual string Sender { get; private set; } |
|||
public virtual string Provider { get; set; } |
|||
public virtual string Receiver { get; private set; } |
|||
public virtual string Content { get; private set; } |
|||
public virtual DateTime? SendTime { get; private set; } |
|||
public virtual int SendCount { get; private set; } |
|||
public virtual MessageStatus Status { get; private set; } |
|||
public virtual string Reason { get; private set; } |
|||
|
|||
protected Message() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public Message( |
|||
Guid id, |
|||
string receiver, |
|||
string content, |
|||
Guid? userId = null, |
|||
string userName = null) |
|||
: base(id) |
|||
{ |
|||
Receiver = Check.NotNullOrWhiteSpace(receiver, nameof(receiver), MessageConsts.MaxReceiverLength); |
|||
Content = content; |
|||
|
|||
UserId = userId; |
|||
Sender = Check.Length(userName, nameof(userName), MessageConsts.MaxSenderLength); |
|||
SendCount = 0; |
|||
Status = MessageStatus.Pending; |
|||
} |
|||
|
|||
public void Sent(IClock clock) |
|||
{ |
|||
SendCount += 1; |
|||
SendTime = clock.Now; |
|||
Status = MessageStatus.Sent; |
|||
Reason = ""; |
|||
} |
|||
|
|||
public void Failed(string error, IClock clock) |
|||
{ |
|||
SendTime = clock.Now; |
|||
Status = MessageStatus.Failed; |
|||
Reason = error.Truncate(MessageConsts.MaxReasonLength); |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.BlobStoring; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
[BlobContainerName("messaging")] |
|||
public class MessagingContainer |
|||
{ |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class SmsMessage : Message |
|||
{ |
|||
protected SmsMessage() |
|||
{ |
|||
} |
|||
public SmsMessage( |
|||
Guid id, |
|||
string phoneNumber, |
|||
string content, |
|||
Guid? userId = null, |
|||
string userName = null) |
|||
: base(id, phoneNumber, content, userId, userName) |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
using Volo.Abp.DynamicProxy; |
|||
using Volo.Abp.Sms; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
public class SmsMessageManager : DomainService, ISmsMessageManager |
|||
{ |
|||
protected ISmsMessageRepository Repository { get; } |
|||
public SmsMessageManager(ISmsMessageRepository repository) |
|||
{ |
|||
Repository = repository; |
|||
} |
|||
|
|||
public async virtual Task<SmsMessage> SendAsync(SmsMessage message) |
|||
{ |
|||
var smsSender = GetSmsSender(); |
|||
|
|||
message.Provider = ProxyHelper.GetUnProxiedType(smsSender).Name; |
|||
|
|||
var error = await TrySendAsync(smsSender, message); |
|||
if (error.IsNullOrWhiteSpace()) |
|||
{ |
|||
message.Sent(Clock); |
|||
} |
|||
else |
|||
{ |
|||
message.Failed(error, Clock); |
|||
} |
|||
|
|||
return message; |
|||
} |
|||
|
|||
public async virtual Task<string> TrySendAsync(ISmsSender smsSender, SmsMessage message) |
|||
{ |
|||
try |
|||
{ |
|||
var smsMessage = new Volo.Abp.Sms.SmsMessage( |
|||
message.Receiver, |
|||
message.Content); |
|||
|
|||
foreach (var prop in message.ExtraProperties) |
|||
{ |
|||
smsMessage.Properties.Add(prop.Key, prop.Value); |
|||
} |
|||
|
|||
await smsSender.SendAsync(smsMessage); |
|||
|
|||
return null; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Logger.LogWarning("Failed to send a short message, error: {message}", ex.ToString()); |
|||
|
|||
return ex.Message; |
|||
} |
|||
} |
|||
|
|||
protected virtual ISmsSender GetSmsSender() |
|||
{ |
|||
return LazyServiceProvider.LazyGetRequiredService<ISmsSender>(); |
|||
} |
|||
} |
|||
@ -1,20 +1,24 @@ |
|||
using AutoMapper; |
|||
using AutoMapper; |
|||
using LINGYUN.Platform.Layouts; |
|||
using LINGYUN.Platform.Menus; |
|||
using LINGYUN.Platform.Messages; |
|||
using LINGYUN.Platform.Packages; |
|||
|
|||
namespace LINGYUN.Platform; |
|||
|
|||
public class PlatformDomainMappingProfile : Profile |
|||
{ |
|||
public PlatformDomainMappingProfile() |
|||
{ |
|||
CreateMap<Layout, LayoutEto>(); |
|||
|
|||
CreateMap<Menu, MenuEto>(); |
|||
CreateMap<UserMenu, UserMenuEto>(); |
|||
CreateMap<RoleMenu, RoleMenuEto>(); |
|||
|
|||
CreateMap<Package, PackageEto>(); |
|||
} |
|||
} |
|||
|
|||
namespace LINGYUN.Platform; |
|||
|
|||
public class PlatformDomainMappingProfile : Profile |
|||
{ |
|||
public PlatformDomainMappingProfile() |
|||
{ |
|||
CreateMap<Layout, LayoutEto>(); |
|||
|
|||
CreateMap<Menu, MenuEto>(); |
|||
CreateMap<UserMenu, UserMenuEto>(); |
|||
CreateMap<RoleMenu, RoleMenuEto>(); |
|||
|
|||
CreateMap<Package, PackageEto>(); |
|||
|
|||
CreateMap<EmailMessage, EmailMessageEto>(); |
|||
CreateMap<SmsMessage, SmsMessageEto>(); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,49 @@ |
|||
using LINGYUN.Platform.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Linq.Dynamic.Core; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Specifications; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EfCoreEmailMessageRepository : EfCoreRepository<IPlatformDbContext, EmailMessage, Guid>, IEmailMessageRepository |
|||
{ |
|||
public EfCoreEmailMessageRepository( |
|||
IDbContextProvider<IPlatformDbContext> dbContextProvider) |
|||
: base(dbContextProvider) |
|||
{ |
|||
} |
|||
|
|||
public async virtual Task<int> GetCountAsync(ISpecification<EmailMessage> specification, CancellationToken cancellationToken = default) |
|||
{ |
|||
return await (await GetDbSetAsync()) |
|||
.Where(specification.ToExpression()) |
|||
.CountAsync(GetCancellationToken(cancellationToken)); |
|||
} |
|||
|
|||
public async virtual Task<List<EmailMessage>> GetListAsync( |
|||
ISpecification<EmailMessage> specification, |
|||
string sorting = $"{nameof(Message.CreationTime)} DESC", |
|||
int maxResultCount = 10, |
|||
int skipCount = 0, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await (await GetDbSetAsync()) |
|||
.Where(specification.ToExpression()) |
|||
.OrderBy(sorting.IsNullOrWhiteSpace() ? $"{nameof(Message.CreationTime)} DESC" : sorting) |
|||
.PageBy(skipCount, maxResultCount) |
|||
.ToListAsync(GetCancellationToken(cancellationToken)); |
|||
} |
|||
|
|||
public async override Task<IQueryable<EmailMessage>> WithDetailsAsync() |
|||
{ |
|||
return (await base.WithDetailsAsync()) |
|||
.Include(x => x.Attachments) |
|||
.Include(x => x.Headers); |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
using LINGYUN.Platform.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Linq.Dynamic.Core; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Specifications; |
|||
|
|||
namespace LINGYUN.Platform.Messages; |
|||
public class EfCoreSmsMessageRepository : EfCoreRepository<IPlatformDbContext, SmsMessage, Guid>, ISmsMessageRepository |
|||
{ |
|||
public EfCoreSmsMessageRepository( |
|||
IDbContextProvider<IPlatformDbContext> dbContextProvider) |
|||
: base(dbContextProvider) |
|||
{ |
|||
} |
|||
|
|||
public async virtual Task<int> GetCountAsync(ISpecification<SmsMessage> specification, CancellationToken cancellationToken = default) |
|||
{ |
|||
return await (await GetDbSetAsync()) |
|||
.Where(specification.ToExpression()) |
|||
.CountAsync(GetCancellationToken(cancellationToken)); |
|||
} |
|||
|
|||
public async virtual Task<List<SmsMessage>> GetListAsync( |
|||
ISpecification<SmsMessage> specification, |
|||
string sorting = $"{nameof(Message.CreationTime)} DESC", |
|||
int maxResultCount = 10, |
|||
int skipCount = 0, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await (await GetDbSetAsync()) |
|||
.Where(specification.ToExpression()) |
|||
.OrderBy(sorting.IsNullOrWhiteSpace() ? $"{nameof(Message.CreationTime)} DESC" : sorting) |
|||
.PageBy(skipCount, maxResultCount) |
|||
.ToListAsync(GetCancellationToken(cancellationToken)); |
|||
} |
|||
} |
|||
@ -0,0 +1,110 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Datas; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Datas; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IDataAppService), typeof(DataClientProxy))] |
|||
public partial class DataClientProxy : ClientProxyBase<IDataAppService>, IDataAppService |
|||
{ |
|||
public virtual async Task<DataDto> CreateAsync(DataCreateDto input) |
|||
{ |
|||
return await RequestAsync<DataDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(DataCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task CreateItemAsync(Guid id, DataItemCreateDto input) |
|||
{ |
|||
await RequestAsync(nameof(CreateItemAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(DataItemCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteItemAsync(Guid id, string name) |
|||
{ |
|||
await RequestAsync(nameof(DeleteItemAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(string), name } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<DataDto> GetAsync(string name) |
|||
{ |
|||
return await RequestAsync<DataDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), name } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<DataDto> GetAsync(Guid id) |
|||
{ |
|||
return await RequestAsync<DataDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<DataDto>> GetAllAsync() |
|||
{ |
|||
return await RequestAsync<ListResultDto<DataDto>>(nameof(GetAllAsync)); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<DataDto>> GetListAsync(GetDataListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<DataDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(GetDataListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<DataDto> MoveAsync(Guid id, DataMoveDto input) |
|||
{ |
|||
return await RequestAsync<DataDto>(nameof(MoveAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(DataMoveDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<DataDto> UpdateAsync(Guid id, DataUpdateDto input) |
|||
{ |
|||
return await RequestAsync<DataDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(DataUpdateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input) |
|||
{ |
|||
await RequestAsync(nameof(UpdateItemAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(string), name }, |
|||
{ typeof(DataItemUpdateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of DataClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Datas; |
|||
|
|||
public partial class DataClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Feedbacks; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Content; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Feedbacks; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IFeedbackAttachmentAppService), typeof(FeedbackAttachmentClientProxy))] |
|||
public partial class FeedbackAttachmentClientProxy : ClientProxyBase<IFeedbackAttachmentAppService>, IFeedbackAttachmentAppService |
|||
{ |
|||
public virtual async Task<IRemoteStreamContent> GetAsync(FeedbackAttachmentGetInput input) |
|||
{ |
|||
return await RequestAsync<IRemoteStreamContent>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(FeedbackAttachmentGetInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<FeedbackAttachmentTempFileDto> UploadAsync(FeedbackAttachmentUploadInput input) |
|||
{ |
|||
return await RequestAsync<FeedbackAttachmentTempFileDto>(nameof(UploadAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(FeedbackAttachmentUploadInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(FeedbackAttachmentGetInput input) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(FeedbackAttachmentGetInput), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of FeedbackAttachmentClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Feedbacks; |
|||
|
|||
public partial class FeedbackAttachmentClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Feedbacks; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Feedbacks; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IFeedbackAppService), typeof(FeedbackClientProxy))] |
|||
public partial class FeedbackClientProxy : ClientProxyBase<IFeedbackAppService>, IFeedbackAppService |
|||
{ |
|||
public virtual async Task<FeedbackDto> CreateAsync(FeedbackCreateDto input) |
|||
{ |
|||
return await RequestAsync<FeedbackDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(FeedbackCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<FeedbackDto> GetAsync(Guid id) |
|||
{ |
|||
return await RequestAsync<FeedbackDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<FeedbackDto>> GetListAsync(FeedbackGetListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<FeedbackDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(FeedbackGetListInput), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of FeedbackClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Feedbacks; |
|||
|
|||
public partial class FeedbackClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Feedbacks; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Feedbacks; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IMyFeedbackAppService), typeof(MyFeedbackClientProxy))] |
|||
public partial class MyFeedbackClientProxy : ClientProxyBase<IMyFeedbackAppService>, IMyFeedbackAppService |
|||
{ |
|||
public virtual async Task<PagedResultDto<FeedbackDto>> GetMyFeedbacksAsync(FeedbackGetListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<FeedbackDto>>(nameof(GetMyFeedbacksAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(FeedbackGetListInput), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of MyFeedbackClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Feedbacks; |
|||
|
|||
public partial class MyFeedbackClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Layouts; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Layouts; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(ILayoutAppService), typeof(LayoutClientProxy))] |
|||
public partial class LayoutClientProxy : ClientProxyBase<ILayoutAppService>, ILayoutAppService |
|||
{ |
|||
public virtual async Task<LayoutDto> CreateAsync(LayoutCreateDto input) |
|||
{ |
|||
return await RequestAsync<LayoutDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(LayoutCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<LayoutDto> GetAsync(Guid id) |
|||
{ |
|||
return await RequestAsync<LayoutDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<LayoutDto>> GetAllListAsync() |
|||
{ |
|||
return await RequestAsync<ListResultDto<LayoutDto>>(nameof(GetAllListAsync)); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<LayoutDto>> GetListAsync(GetLayoutListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<LayoutDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(GetLayoutListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<LayoutDto> UpdateAsync(Guid id, LayoutUpdateDto input) |
|||
{ |
|||
return await RequestAsync<LayoutDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(LayoutUpdateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of LayoutClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Layouts; |
|||
|
|||
public partial class LayoutClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,126 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Menus; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Menus; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IMenuAppService), typeof(MenuClientProxy))] |
|||
public partial class MenuClientProxy : ClientProxyBase<IMenuAppService>, IMenuAppService |
|||
{ |
|||
public virtual async Task<ListResultDto<MenuDto>> GetCurrentUserMenuListAsync(GetMenuInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<MenuDto>>(nameof(GetCurrentUserMenuListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(GetMenuInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<MenuDto> GetAsync(Guid id) |
|||
{ |
|||
return await RequestAsync<MenuDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<MenuDto>> GetAllAsync(MenuGetAllInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<MenuDto>>(nameof(GetAllAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(MenuGetAllInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<MenuDto>> GetListAsync(MenuGetListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<MenuDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(MenuGetListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<MenuDto> CreateAsync(MenuCreateDto input) |
|||
{ |
|||
return await RequestAsync<MenuDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(MenuCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<MenuDto> UpdateAsync(Guid id, MenuUpdateDto input) |
|||
{ |
|||
return await RequestAsync<MenuDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(MenuUpdateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task SetUserMenusAsync(UserMenuInput input) |
|||
{ |
|||
await RequestAsync(nameof(SetUserMenusAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(UserMenuInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task SetUserStartupAsync(Guid id, UserMenuStartupInput input) |
|||
{ |
|||
await RequestAsync(nameof(SetUserStartupAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(UserMenuStartupInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<MenuDto>> GetUserMenuListAsync(MenuGetByUserInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<MenuDto>>(nameof(GetUserMenuListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(MenuGetByUserInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task SetRoleMenusAsync(RoleMenuInput input) |
|||
{ |
|||
await RequestAsync(nameof(SetRoleMenusAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(RoleMenuInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task SetRoleStartupAsync(Guid id, RoleMenuStartupInput input) |
|||
{ |
|||
await RequestAsync(nameof(SetRoleStartupAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(RoleMenuStartupInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<MenuDto>> GetRoleMenuListAsync(MenuGetByRoleInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<MenuDto>>(nameof(GetRoleMenuListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(MenuGetByRoleInput), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of MenuClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Menus; |
|||
|
|||
public partial class MenuClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Menus; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Menus; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IUserFavoriteMenuAppService), typeof(UserFavoriteMenuClientProxy))] |
|||
public partial class UserFavoriteMenuClientProxy : ClientProxyBase<IUserFavoriteMenuAppService>, IUserFavoriteMenuAppService |
|||
{ |
|||
public virtual async Task<UserFavoriteMenuDto> CreateAsync(Guid userId, UserFavoriteMenuCreateDto input) |
|||
{ |
|||
return await RequestAsync<UserFavoriteMenuDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), userId }, |
|||
{ typeof(UserFavoriteMenuCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<UserFavoriteMenuDto> CreateMyFavoriteMenuAsync(UserFavoriteMenuCreateDto input) |
|||
{ |
|||
return await RequestAsync<UserFavoriteMenuDto>(nameof(CreateMyFavoriteMenuAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(UserFavoriteMenuCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(Guid userId, UserFavoriteMenuRemoveInput input) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), userId }, |
|||
{ typeof(UserFavoriteMenuRemoveInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteMyFavoriteMenuAsync(UserFavoriteMenuRemoveInput input) |
|||
{ |
|||
await RequestAsync(nameof(DeleteMyFavoriteMenuAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(UserFavoriteMenuRemoveInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<UserFavoriteMenuDto>> GetListAsync(Guid userId, UserFavoriteMenuGetListInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<UserFavoriteMenuDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), userId }, |
|||
{ typeof(UserFavoriteMenuGetListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<UserFavoriteMenuDto>> GetMyFavoriteMenuListAsync(UserFavoriteMenuGetListInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<UserFavoriteMenuDto>>(nameof(GetMyFavoriteMenuListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(UserFavoriteMenuGetListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<UserFavoriteMenuDto> UpdateAsync(Guid userId, UserFavoriteMenuUpdateDto input) |
|||
{ |
|||
return await RequestAsync<UserFavoriteMenuDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), userId }, |
|||
{ typeof(UserFavoriteMenuUpdateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<UserFavoriteMenuDto> UpdateMyFavoriteMenuAsync(UserFavoriteMenuUpdateDto input) |
|||
{ |
|||
return await RequestAsync<UserFavoriteMenuDto>(nameof(UpdateMyFavoriteMenuAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(UserFavoriteMenuUpdateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of UserFavoriteMenuClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Menus; |
|||
|
|||
public partial class UserFavoriteMenuClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Messages; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IEmailMessageAppService), typeof(EmailMessageClientProxy))] |
|||
public partial class EmailMessageClientProxy : ClientProxyBase<IEmailMessageAppService>, IEmailMessageAppService |
|||
{ |
|||
public virtual async Task DeleteAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<EmailMessageDto> GetAsync(Guid id) |
|||
{ |
|||
return await RequestAsync<EmailMessageDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<EmailMessageDto>> GetListAsync(EmailMessageGetListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<EmailMessageDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(EmailMessageGetListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task SendAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(SendAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of EmailMessageClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
public partial class EmailMessageClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Messages; |
|||
using LINGYUN.Platform.Messages.Integration; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IEmailMessageIntegrationService), typeof(EmailMessageIntegrationClientProxy))] |
|||
[IntegrationService] |
|||
public partial class EmailMessageIntegrationClientProxy : ClientProxyBase<IEmailMessageIntegrationService>, IEmailMessageIntegrationService |
|||
{ |
|||
public virtual async Task<EmailMessageDto> CreateAsync(EmailMessageCreateDto input) |
|||
{ |
|||
return await RequestAsync<EmailMessageDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(EmailMessageCreateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of EmailMessageIntegrationClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
|
|||
public partial class EmailMessageIntegrationClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Messages; |
|||
using LINGYUN.Platform.Messages.Integration; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(ISmsMessageIntegrationService), typeof(SmsMessageIntegrationClientProxy))] |
|||
[IntegrationService] |
|||
public partial class SmsMessageIntegrationClientProxy : ClientProxyBase<ISmsMessageIntegrationService>, ISmsMessageIntegrationService |
|||
{ |
|||
public virtual async Task<SmsMessageDto> CreateAsync(SmsMessageCreateDto input) |
|||
{ |
|||
return await RequestAsync<SmsMessageDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(SmsMessageCreateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of SmsMessageIntegrationClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages.Integration; |
|||
|
|||
public partial class SmsMessageIntegrationClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Messages; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(ISmsMessageAppService), typeof(SmsMessageClientProxy))] |
|||
public partial class SmsMessageClientProxy : ClientProxyBase<ISmsMessageAppService>, ISmsMessageAppService |
|||
{ |
|||
public virtual async Task DeleteAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<SmsMessageDto> GetAsync(Guid id) |
|||
{ |
|||
return await RequestAsync<SmsMessageDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<SmsMessageDto>> GetListAsync(SmsMessageGetListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<SmsMessageDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(SmsMessageGetListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task SendAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(SendAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of SmsMessageClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Messages; |
|||
|
|||
public partial class SmsMessageClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Platform.Packages; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Content; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Platform.Packages; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IPackageAppService), typeof(PackageClientProxy))] |
|||
public partial class PackageClientProxy : ClientProxyBase<IPackageAppService>, IPackageAppService |
|||
{ |
|||
public virtual async Task<PackageDto> CreateAsync(PackageCreateDto input) |
|||
{ |
|||
return await RequestAsync<PackageDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(PackageCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(Guid id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PackageBlobDto> UploadBlobAsync(Guid id, PackageBlobUploadDto input) |
|||
{ |
|||
return await RequestAsync<PackageBlobDto>(nameof(UploadBlobAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(PackageBlobUploadDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task RemoveBlobAsync(Guid id, PackageBlobRemoveDto input) |
|||
{ |
|||
await RequestAsync(nameof(RemoveBlobAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(PackageBlobRemoveDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<IRemoteStreamContent> DownloadBlobAsync(Guid id, PackageBlobDownloadInput input) |
|||
{ |
|||
return await RequestAsync<IRemoteStreamContent>(nameof(DownloadBlobAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(PackageBlobDownloadInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PackageDto> GetAsync(Guid id) |
|||
{ |
|||
return await RequestAsync<PackageDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PackageDto> GetLatestAsync(PackageGetLatestInput input) |
|||
{ |
|||
return await RequestAsync<PackageDto>(nameof(GetLatestAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(PackageGetLatestInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<PackageDto>> GetListAsync(PackageGetPagedListInput input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<PackageDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(PackageGetPagedListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PackageDto> UpdateAsync(Guid id, PackageUpdateDto input) |
|||
{ |
|||
return await RequestAsync<PackageDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(Guid), id }, |
|||
{ typeof(PackageUpdateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue