46 changed files with 5649 additions and 204 deletions
@ -0,0 +1,3 @@ |
|||||
|
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
||||
|
<ConfigureAwait ContinueOnCapturedContext="false" /> |
||||
|
</Weavers> |
||||
File diff suppressed because it is too large
@ -0,0 +1,77 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace LY.MicroService.AuthServer.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class AddGdprModule : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpGdprRequests", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
ReadyTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
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") |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpGdprRequests", x => x.Id); |
||||
|
}) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpGdprInfos", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
RequestId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
Data = table.Column<string>(type: "longtext", nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Provider = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpGdprInfos", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpGdprInfos_AbpGdprRequests_RequestId", |
||||
|
column: x => x.RequestId, |
||||
|
principalTable: "AbpGdprRequests", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpGdprInfos_RequestId", |
||||
|
table: "AbpGdprInfos", |
||||
|
column: "RequestId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpGdprRequests_UserId", |
||||
|
table: "AbpGdprRequests", |
||||
|
column: "UserId"); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpGdprInfos"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpGdprRequests"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,77 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace LY.MicroService.IdentityServer.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class AddGdprModule : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpGdprRequests", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
ReadyTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
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") |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpGdprRequests", x => x.Id); |
||||
|
}) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpGdprInfos", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
RequestId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
Data = table.Column<string>(type: "longtext", nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Provider = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpGdprInfos", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpGdprInfos_AbpGdprRequests_RequestId", |
||||
|
column: x => x.RequestId, |
||||
|
principalTable: "AbpGdprRequests", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpGdprInfos_RequestId", |
||||
|
table: "AbpGdprInfos", |
||||
|
column: "RequestId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpGdprRequests_UserId", |
||||
|
table: "AbpGdprRequests", |
||||
|
column: "UserId"); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpGdprInfos"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpGdprRequests"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
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.Platform.EntityFrameworkCore.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), |
||||
|
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), |
||||
|
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"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,57 +0,0 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Options; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp; |
|
||||
using Volo.Abp.DependencyInjection; |
|
||||
using Volo.Abp.TextTemplating; |
|
||||
|
|
||||
namespace LINGYUN.Abp.TextTemplating; |
|
||||
|
|
||||
[Dependency(ReplaceServices = true)] |
|
||||
[ExposeServices( |
|
||||
typeof(ITemplateRenderer), |
|
||||
typeof(AbpTemplateRenderer))] |
|
||||
public class TextTemplateRenderer : AbpTemplateRenderer, ITransientDependency |
|
||||
{ |
|
||||
protected ITemplateDefinitionStore TemplateDefinitionStore { get; } |
|
||||
public TextTemplateRenderer( |
|
||||
IServiceScopeFactory serviceScopeFactory, |
|
||||
ITemplateDefinitionManager templateDefinitionManager, |
|
||||
ITemplateDefinitionStore templateDefinitionStore, |
|
||||
IOptions<AbpTextTemplatingOptions> options) |
|
||||
: base(serviceScopeFactory, templateDefinitionManager, options) |
|
||||
{ |
|
||||
TemplateDefinitionStore = templateDefinitionStore; |
|
||||
} |
|
||||
|
|
||||
public override async Task<string> RenderAsync( |
|
||||
string templateName, |
|
||||
object model = null, |
|
||||
string cultureName = null, |
|
||||
Dictionary<string, object> globalContext = null) |
|
||||
{ |
|
||||
var templateDefinition = await TemplateDefinitionStore.GetAsync(templateName); |
|
||||
|
|
||||
var renderEngine = templateDefinition.RenderEngine; |
|
||||
|
|
||||
if (renderEngine.IsNullOrWhiteSpace()) |
|
||||
{ |
|
||||
renderEngine = Options.DefaultRenderingEngine; |
|
||||
} |
|
||||
|
|
||||
var providerType = Options.RenderingEngines.GetOrDefault(renderEngine); |
|
||||
|
|
||||
if (providerType != null && typeof(ITemplateRenderingEngine).IsAssignableFrom(providerType)) |
|
||||
{ |
|
||||
using (var scope = ServiceScopeFactory.CreateScope()) |
|
||||
{ |
|
||||
var templateRenderingEngine = (ITemplateRenderingEngine)scope.ServiceProvider.GetRequiredService(providerType); |
|
||||
return await templateRenderingEngine.RenderAsync(templateName, model, cultureName, globalContext); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
throw new AbpException("There is no rendering engine found with template name: " + templateName); |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue