| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using Abp.Domain.Entities;
- using Abp.Domain.Entities.Auditing;
- namespace Abp.Notifications
- {
- /// <summary>
- /// A notification distributed to it's related tenant.
- /// </summary>
- [Table("AbpTenantNotifications")]
- public class TenantNotificationInfo : CreationAuditedEntity<Guid>, IMayHaveTenant
- {
- /// <summary>
- /// Tenant id of the subscribed user.
- /// </summary>
- public virtual int? TenantId { get; set; }
- /// <summary>
- /// Unique notification name.
- /// </summary>
- [Required]
- [StringLength(NotificationInfo.MaxNotificationNameLength)]
- public virtual string NotificationName { get; set; }
- /// <summary>
- /// Notification data as JSON string.
- /// </summary>
- [StringLength(NotificationInfo.MaxDataLength)]
- public virtual string Data { get; set; }
- /// <summary>
- /// Type of the JSON serialized <see cref="Data"/>.
- /// It's AssemblyQualifiedName of the type.
- /// </summary>
- [StringLength(NotificationInfo.MaxDataTypeNameLength)]
- public virtual string DataTypeName { get; set; }
- /// <summary>
- /// Gets/sets entity type name, if this is an entity level notification.
- /// It's FullName of the entity type.
- /// </summary>
- [StringLength(NotificationInfo.MaxEntityTypeNameLength)]
- public virtual string EntityTypeName { get; set; }
- /// <summary>
- /// AssemblyQualifiedName of the entity type.
- /// </summary>
- [StringLength(NotificationInfo.MaxEntityTypeAssemblyQualifiedNameLength)]
- public virtual string EntityTypeAssemblyQualifiedName { get; set; }
- /// <summary>
- /// Gets/sets primary key of the entity, if this is an entity level notification.
- /// </summary>
- [StringLength(NotificationInfo.MaxEntityIdLength)]
- public virtual string EntityId { get; set; }
- /// <summary>
- /// Notification severity.
- /// </summary>
- public virtual NotificationSeverity Severity { get; set; }
- public TenantNotificationInfo()
- {
-
- }
- public TenantNotificationInfo(Guid id, int? tenantId, NotificationInfo notification)
- {
- Id = id;
- TenantId = tenantId;
- NotificationName = notification.NotificationName;
- Data = notification.Data;
- DataTypeName = notification.DataTypeName;
- EntityTypeName = notification.EntityTypeName;
- EntityTypeAssemblyQualifiedName = notification.EntityTypeAssemblyQualifiedName;
- EntityId = notification.EntityId;
- Severity = notification.Severity;
- }
- }
- }
|