49 changed files with 1859 additions and 649 deletions
@ -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,23 @@ |
|||
using System.Linq; |
|||
using Volo.Abp.TextTemplating; |
|||
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
public class AbpNotificationTemplateDefinitionProvider : TemplateDefinitionProvider |
|||
{ |
|||
private readonly INotificationDefinitionManager _notificationDefinitionManager; |
|||
|
|||
public AbpNotificationTemplateDefinitionProvider( |
|||
INotificationDefinitionManager notificationDefinitionManager) |
|||
{ |
|||
_notificationDefinitionManager = notificationDefinitionManager; |
|||
} |
|||
|
|||
public override void Define(ITemplateDefinitionContext context) |
|||
{ |
|||
var notifications = _notificationDefinitionManager.GetAll().Where(n => n.Template != null); |
|||
foreach (var notification in notifications) |
|||
{ |
|||
context.Add(notification.Template); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
public class NotificationTemplateDto |
|||
{ |
|||
public string Name { get; set; } |
|||
public string Description { get; set; } |
|||
public string Title { get; set; } |
|||
public string Content { get; set; } |
|||
public string Culture { get; set; } |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
public class NotificationTemplateGetInput |
|||
{ |
|||
[Required] |
|||
public string Name { get; set; } |
|||
|
|||
public string Culture { get; set; } |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
public class NotificationTemplateSetInput |
|||
{ |
|||
[Required] |
|||
[DynamicStringLength(typeof(NotificationTemplateConsts), nameof(NotificationTemplateConsts.MaxNameLength))] |
|||
public string Name { get; set; } |
|||
|
|||
[Required] |
|||
[DynamicStringLength(typeof(NotificationTemplateConsts), nameof(NotificationTemplateConsts.MaxCultureLength))] |
|||
public string Culture { get; set; } |
|||
|
|||
[Required] |
|||
[DynamicStringLength(typeof(NotificationTemplateConsts), nameof(NotificationTemplateConsts.MaxContentLength))] |
|||
public string Content { get; set; } |
|||
} |
|||
@ -1,9 +1,16 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications |
|||
{ |
|||
public interface INotificationAppService |
|||
{ |
|||
Task<NotificationTemplateDto> SetTemplateAsync(NotificationTemplateSetInput input); |
|||
|
|||
Task<NotificationTemplateDto> GetTemplateAsync(NotificationTemplateGetInput input); |
|||
|
|||
Task<ListResultDto<NotificationTemplateDto>> GetAssignableTemplatesAsync(); |
|||
|
|||
Task SendAsync(NotificationSendDto input); |
|||
} |
|||
} |
|||
|
|||
@ -1,35 +1,137 @@ |
|||
using LINGYUN.Abp.Notifications; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using System.Collections.Generic; |
|||
using System.Globalization; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.TextTemplating; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications |
|||
{ |
|||
[Authorize] |
|||
public class NotificationAppService : ApplicationService, INotificationAppService |
|||
{ |
|||
protected ITemplateContentProvider TemplateContentProvider { get; } |
|||
protected INotificationSender NotificationSender { get; } |
|||
protected INotificationDefinitionManager NotificationDefinitionManager { get; } |
|||
protected INotificationTemplateRepository NotificationTemplateRepository { get; } |
|||
|
|||
public NotificationAppService( |
|||
INotificationSender notificationSender) |
|||
INotificationSender notificationSender, |
|||
ITemplateContentProvider templateContentProvider, |
|||
INotificationDefinitionManager notificationDefinitionManager, |
|||
INotificationTemplateRepository notificationTemplateRepository) |
|||
{ |
|||
NotificationSender = notificationSender; |
|||
TemplateContentProvider = templateContentProvider; |
|||
NotificationDefinitionManager = notificationDefinitionManager; |
|||
NotificationTemplateRepository = notificationTemplateRepository; |
|||
} |
|||
|
|||
public virtual async Task SendAsync(NotificationSendDto input) |
|||
public async virtual Task<NotificationTemplateDto> SetTemplateAsync(NotificationTemplateSetInput input) |
|||
{ |
|||
var notification = GetNotificationDefinition(input.Name); |
|||
|
|||
var template = await NotificationTemplateRepository.GetByNameAsync(input.Name, input.Culture); |
|||
if (template == null) |
|||
{ |
|||
template = new NotificationTemplate( |
|||
GuidGenerator.Create(), |
|||
notification.Name, |
|||
notification.DisplayName.Localize(StringLocalizerFactory), |
|||
input.Content, |
|||
input.Culture, |
|||
notification.Description?.Localize(StringLocalizerFactory)); |
|||
|
|||
template = await NotificationTemplateRepository.InsertAsync(template); |
|||
} |
|||
else |
|||
{ |
|||
template.SetContent(input.Content); |
|||
|
|||
await NotificationTemplateRepository.UpdateAsync(template); |
|||
} |
|||
|
|||
await CurrentUnitOfWork.SaveChangesAsync(); |
|||
|
|||
return ObjectMapper.Map<NotificationTemplate, NotificationTemplateDto>(template); |
|||
} |
|||
|
|||
public async virtual Task<NotificationTemplateDto> GetTemplateAsync(NotificationTemplateGetInput input) |
|||
{ |
|||
var notification = GetNotificationDefinition(input.Name); |
|||
|
|||
var culture = input.Culture ?? CultureInfo.CurrentCulture.Name; |
|||
var content = await TemplateContentProvider.GetContentOrNullAsync(notification.Name, culture); |
|||
|
|||
return new NotificationTemplateDto |
|||
{ |
|||
Culture = culture, |
|||
Content = content, |
|||
Name = notification.Name, |
|||
Title = notification.DisplayName.Localize(StringLocalizerFactory), |
|||
Description = notification.Description?.Localize(StringLocalizerFactory), |
|||
}; |
|||
} |
|||
|
|||
public virtual Task<ListResultDto<NotificationTemplateDto>> GetAssignableTemplatesAsync() |
|||
{ |
|||
var templates = new List<NotificationTemplateDto>(); |
|||
var notifications = NotificationDefinitionManager.GetAll().Where(n => n.Template != null); |
|||
|
|||
foreach (var notification in notifications) |
|||
{ |
|||
templates.Add( |
|||
new NotificationTemplateDto |
|||
{ |
|||
Name = notification.Name, |
|||
Culture = CultureInfo.CurrentCulture.Name, |
|||
Title = notification.DisplayName.Localize(StringLocalizerFactory), |
|||
Description = notification.Description?.Localize(StringLocalizerFactory), |
|||
}); |
|||
} |
|||
|
|||
return Task.FromResult(new ListResultDto<NotificationTemplateDto>(templates)); |
|||
} |
|||
|
|||
public async virtual Task SendAsync(NotificationSendDto input) |
|||
{ |
|||
var notification = GetNotificationDefinition(input.Name); |
|||
|
|||
UserIdentifier user = null; |
|||
if (input.ToUserId.HasValue) |
|||
{ |
|||
user = new UserIdentifier(input.ToUserId.Value, input.ToUserName); |
|||
} |
|||
|
|||
await NotificationSender |
|||
.SendNofiterAsync( |
|||
input.Name, |
|||
input.Data, |
|||
user, |
|||
name: input.Name, |
|||
template: new Abp.Notifications.NotificationTemplate( |
|||
notification.Name, |
|||
culture: input.Culture ?? CultureInfo.CurrentCulture.Name, |
|||
formUser: CurrentUser.Name ?? CurrentUser.UserName, |
|||
data: input.Data), |
|||
user: user, |
|||
CurrentTenant.Id, |
|||
input.Severity); |
|||
} |
|||
|
|||
protected virtual NotificationDefinition GetNotificationDefinition(string name) |
|||
{ |
|||
var notification = NotificationDefinitionManager.GetOrNull(name); |
|||
if (notification == null || notification.Template == null) |
|||
{ |
|||
throw new BusinessException( |
|||
MessageServiceErrorCodes.NotificationTemplateNotFound, |
|||
$"The notification template {name} does not exist!") |
|||
.WithData("Name", name); |
|||
} |
|||
|
|||
return notification; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
public static class NotificationTemplateConsts |
|||
{ |
|||
public static int MaxNameLength { get; set; } = 100; |
|||
|
|||
public static int MaxTitleLength { get; set; } = 100; |
|||
|
|||
public static int MaxContentLength { get; set; } = 1024 * 1024; |
|||
|
|||
public static int MaxDescriptionLength { get; set; } = 255; |
|||
|
|||
public static int MaxCultureLength { get; set; } = 30; |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
public interface INotificationTemplateRepository : IBasicRepository<NotificationTemplate, Guid> |
|||
{ |
|||
Task<NotificationTemplate> GetByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default); |
|||
} |
|||
@ -1,11 +1,37 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
public class NotificationTemplate : AuditedAggregateRoot<Guid> |
|||
public class NotificationTemplate : AuditedEntity<Guid>, IMultiTenant |
|||
{ |
|||
public virtual Guid? TenantId { get; protected set; } |
|||
public virtual string Name { get; private set; } |
|||
public virtual string Description { get; private set; } |
|||
public virtual string Title { get; private set; } |
|||
public virtual string Content { get; private set; } |
|||
public virtual string Culture { get; private set; } |
|||
protected NotificationTemplate() { } |
|||
public NotificationTemplate( |
|||
Guid id, |
|||
string name, |
|||
string title, |
|||
string content, |
|||
string culture, |
|||
string description = null) |
|||
: base(id) |
|||
{ |
|||
Name = Check.NotNullOrWhiteSpace(name, nameof(name), NotificationTemplateConsts.MaxNameLength); |
|||
Title = Check.NotNullOrWhiteSpace(title, nameof(title), NotificationTemplateConsts.MaxTitleLength); |
|||
Content = Check.NotNullOrWhiteSpace(content, nameof(content), NotificationTemplateConsts.MaxContentLength); |
|||
Culture = Check.NotNullOrWhiteSpace(culture, nameof(culture), NotificationTemplateConsts.MaxCultureLength); |
|||
Description = Check.Length(description, nameof(description), NotificationTemplateConsts.MaxDescriptionLength); |
|||
} |
|||
|
|||
public void SetContent(string content) |
|||
{ |
|||
Content = Check.NotNullOrWhiteSpace(content, nameof(content), NotificationTemplateConsts.MaxContentLength); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,31 @@ |
|||
using LINGYUN.Abp.Notifications; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using System.Globalization; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] |
|||
[ExposeServices(typeof(INotificationTemplateStore))] |
|||
public class NotificationTemplateStore : INotificationTemplateStore |
|||
{ |
|||
protected INotificationTemplateRepository NotificationTemplateRepository { get; } |
|||
|
|||
public NotificationTemplateStore( |
|||
INotificationTemplateRepository notificationTemplateRepository) |
|||
{ |
|||
NotificationTemplateRepository = notificationTemplateRepository; |
|||
} |
|||
|
|||
public async virtual Task<string> GetContentOrNullAsync(string templateName, string culture = null, CancellationToken cancellationToken = default) |
|||
{ |
|||
var template = await NotificationTemplateRepository.GetByNameAsync( |
|||
templateName, |
|||
culture ?? CultureInfo.CurrentCulture.Name, |
|||
cancellationToken); |
|||
|
|||
return template?.Content; |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
using LINGYUN.Abp.MessageService.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.MessageService.Notifications; |
|||
|
|||
public class EfCoreNotificationTemplateRepository : |
|||
EfCoreRepository<IMessageServiceDbContext, NotificationTemplate, Guid>, |
|||
INotificationTemplateRepository, |
|||
ITransientDependency |
|||
{ |
|||
public EfCoreNotificationTemplateRepository( |
|||
IDbContextProvider<IMessageServiceDbContext> dbContextProvider) |
|||
: base(dbContextProvider) |
|||
{ |
|||
} |
|||
|
|||
public async virtual Task<NotificationTemplate> GetByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default) |
|||
{ |
|||
return await (await GetDbSetAsync()) |
|||
.Where(x => x.Name.Equals(name)) |
|||
.WhereIf(!culture.IsNullOrWhiteSpace(), x => x.Culture.Equals(culture)) |
|||
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); |
|||
} |
|||
} |
|||
@ -1 +1 @@ |
|||
<h3>A new tenant {{name}} has been created.</h3> |
|||
<h3>A new tenant {{model.name}} has been created.</h3> |
|||
@ -1 +1 @@ |
|||
<h3>一个新的租户 {{name}} 已建立,切换租户开始! </h3> |
|||
<h3>一个新的租户 {{model.name}} 已建立,切换租户开始! </h3> |
|||
@ -1 +1 @@ |
|||
<h3>{{user}}, Welcome to my application!</h3> |
|||
<h3>{{model.name}}, Welcome to my application!</h3> |
|||
@ -1 +1 @@ |
|||
<h3>{{user}}, Welcome to my application!</h3> |
|||
<h3>{{model.name}}, 欢迎您的加入!</h3> |
|||
@ -0,0 +1,690 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LY.MicroService.RealtimeMessage.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.RealtimeMessage.Migrations |
|||
{ |
|||
[DbContext(typeof(RealtimeMessageMigrationsDbContext))] |
|||
[Migration("20220624035652_Add-Entity-Notification-Template")] |
|||
partial class AddEntityNotificationTemplate |
|||
{ |
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "6.0.6") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<int>("Age") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("AvatarUrl") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<DateTime?>("Birthday") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<DateTime?>("LastOnlineTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("NickName") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<int>("Sex") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Sign") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)"); |
|||
|
|||
b.Property<int>("State") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("UserName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "UserId"); |
|||
|
|||
b.ToTable("AppUserChatCards", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<bool>("Black") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)"); |
|||
|
|||
b.Property<bool>("DontDisturb") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<Guid>("FrientId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("RemarkName") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<bool>("SpecialFocus") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("Status") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "UserId", "FrientId"); |
|||
|
|||
b.ToTable("AppUserChatFriends", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<bool>("AllowAddFriend") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("AllowAnonymous") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("AllowReceiveMessage") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("AllowSendMessage") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("RequireAddFriendValition") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "UserId"); |
|||
|
|||
b.ToTable("AppUserChatSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("Content") |
|||
.IsRequired() |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<long>("MessageId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid>("ReceiveUserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("SendUserName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("Source") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<sbyte>("State") |
|||
.HasColumnType("tinyint"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<int>("Type") |
|||
.HasColumnType("int"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "ReceiveUserId"); |
|||
|
|||
b.ToTable("AppUserMessages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.ChatGroup", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("Address") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<Guid>("AdminUserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<bool>("AllowAnonymous") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("AllowSendMessage") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("AvatarUrl") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<long>("GroupId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<int>("MaxUserCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("varchar(20)"); |
|||
|
|||
b.Property<string>("Notice") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Tag") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name"); |
|||
|
|||
b.ToTable("AppChatGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupChatBlack", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<long>("GroupId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid>("ShieldUserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "GroupId"); |
|||
|
|||
b.ToTable("AppGroupChatBlacks", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupMessage", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("Content") |
|||
.IsRequired() |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<long>("GroupId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<long>("MessageId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("SendUserName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("Source") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<sbyte>("State") |
|||
.HasColumnType("tinyint"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<int>("Type") |
|||
.HasColumnType("int"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "GroupId"); |
|||
|
|||
b.ToTable("AppGroupMessages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserChatGroup", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<long>("GroupId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "GroupId", "UserId"); |
|||
|
|||
b.ToTable("AppUserChatGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserGroupCard", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsAdmin") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("NickName") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<DateTime?>("SilenceEnd") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "UserId"); |
|||
|
|||
b.ToTable("AppUserGroupCards", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<DateTime?>("ExpirationTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<long>("NotificationId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("NotificationName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)"); |
|||
|
|||
b.Property<string>("NotificationTypeName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<sbyte>("Severity") |
|||
.HasColumnType("tinyint"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<int>("Type") |
|||
.HasColumnType("int"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "NotificationName"); |
|||
|
|||
b.ToTable("AppNotifications", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.NotificationTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.IsRequired() |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.IsRequired() |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(255) |
|||
.HasColumnType("varchar(255)"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<string>("Title") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Notification_Template_Name"); |
|||
|
|||
b.ToTable("AppNotificationTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<long>("NotificationId") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<int>("ReadStatus") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "UserId", "NotificationId") |
|||
.HasDatabaseName("IX_Tenant_User_Notification_Id"); |
|||
|
|||
b.ToTable("AppUserNotifications", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<string>("NotificationName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("UserName") |
|||
.IsRequired() |
|||
.ValueGeneratedOnAdd() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasDefaultValue("/"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "UserId", "NotificationName") |
|||
.IsUnique() |
|||
.HasDatabaseName("IX_Tenant_User_Notification_Name"); |
|||
|
|||
b.ToTable("AppUserSubscribes", (string)null); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.RealtimeMessage.Migrations |
|||
{ |
|||
public partial class AddEntityNotificationTemplate : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "AppNotificationTemplates", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Description = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Title = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Content = table.Column<string>(type: "longtext", maxLength: 1048576, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Culture = table.Column<string>(type: "varchar(30)", maxLength: 30, 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") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AppNotificationTemplates", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Tenant_Notification_Template_Name", |
|||
table: "AppNotificationTemplates", |
|||
columns: new[] { "TenantId", "Name" }); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AppNotificationTemplates"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,5 +1,5 @@ |
|||
<div style="position: absolute;"> |
|||
<span>{{L "VerifyMyEmailAddress" model.user}}</span> |
|||
<span>{{L "VerifyMyEmailAddress"}}{{model.user}}</span> |
|||
<p style="display:block; padding:0 50px; width: 150px; height:48px; line-height:48px; color:#cc0000; font-size:26px; background:#9c9797; font-weight:bold;">{{model.code}}</p> |
|||
<span>{{L "MailSecurityVerifyRemarks"}}</span> |
|||
</div> |
|||
Loading…
Reference in new issue