|
|
@ -1,5 +1,6 @@ |
|
|
using System; |
|
|
using System; |
|
|
using JetBrains.Annotations; |
|
|
using JetBrains.Annotations; |
|
|
|
|
|
using Volo.Abp; |
|
|
using Volo.Abp.Auditing; |
|
|
using Volo.Abp.Auditing; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
|
|
|
|
|
|
@ -7,12 +8,18 @@ namespace Volo.CmsKit.Ratings |
|
|
{ |
|
|
{ |
|
|
public class Rating : BasicAggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator |
|
|
public class Rating : BasicAggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator |
|
|
{ |
|
|
{ |
|
|
|
|
|
public virtual Guid? TenantId { get; protected set; } |
|
|
|
|
|
|
|
|
|
|
|
public virtual string EntityType { get; protected set; } |
|
|
|
|
|
|
|
|
|
|
|
public virtual string EntityId { get; protected set; } |
|
|
|
|
|
|
|
|
public virtual short StarCount { get; protected set; } |
|
|
public virtual short StarCount { get; protected set; } |
|
|
|
|
|
|
|
|
|
|
|
public virtual Guid CreatorId { get; set; } |
|
|
|
|
|
|
|
|
public virtual DateTime CreationTime { get; set; } |
|
|
public virtual DateTime CreationTime { get; set; } |
|
|
|
|
|
|
|
|
public virtual Guid CreatorId { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
protected Rating() |
|
|
protected Rating() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
@ -20,13 +27,19 @@ namespace Volo.CmsKit.Ratings |
|
|
|
|
|
|
|
|
public Rating( |
|
|
public Rating( |
|
|
Guid id, |
|
|
Guid id, |
|
|
[NotNull] short starCount, |
|
|
[NotNull] string entityType, |
|
|
Guid creatorId |
|
|
[NotNull] string entityId, |
|
|
|
|
|
short starCount, |
|
|
|
|
|
Guid creatorId, |
|
|
|
|
|
Guid? tenantId = null |
|
|
) |
|
|
) |
|
|
: base(id) |
|
|
: base(id) |
|
|
{ |
|
|
{ |
|
|
|
|
|
EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType), RatingConsts.MaxEntityTypeLength); |
|
|
|
|
|
EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), RatingConsts.MaxEntityIdLength); |
|
|
StarCount = starCount; |
|
|
StarCount = starCount; |
|
|
CreatorId = creatorId; |
|
|
CreatorId = creatorId; |
|
|
|
|
|
TenantId = tenantId; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |