mirror of https://github.com/abpframework/abp.git
16 changed files with 197 additions and 43 deletions
@ -1,10 +1,11 @@ |
|||
using JetBrains.Annotations; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.CmsKit.Reactions |
|||
{ |
|||
public class CmsKitReactionOptions |
|||
{ |
|||
[NotNull] |
|||
public ReactionDefinitionDictionary Reactions { get; } = new ReactionDefinitionDictionary(); |
|||
public List<ReactionEntityTypeDefinition> EntityTypes { get; } = new (); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,23 @@ |
|||
|
|||
using JetBrains.Annotations; |
|||
using System.Runtime.Serialization; |
|||
using Volo.Abp; |
|||
|
|||
namespace Volo.CmsKit.Reactions |
|||
{ |
|||
public class EntityCantHaveReactionException : BusinessException |
|||
{ |
|||
public EntityCantHaveReactionException(SerializationInfo serializationInfo, StreamingContext context) : base(serializationInfo, context) |
|||
{ |
|||
} |
|||
|
|||
public EntityCantHaveReactionException([NotNull] string entityType) |
|||
{ |
|||
EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType)); |
|||
Code = CmsKitErrorCodes.Reactions.EntityCantHaveReaction; |
|||
WithData(nameof(EntityType), EntityType); |
|||
} |
|||
|
|||
public string EntityType { get; } |
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace Volo.CmsKit.Reactions |
|||
{ |
|||
public class ReactionDefinitionDictionary : List<ReactionDefinition> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using JetBrains.Annotations; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
|
|||
namespace Volo.CmsKit.Reactions |
|||
{ |
|||
public class ReactionEntityTypeDefinition : PolicySpecifiedDefinition |
|||
{ |
|||
[NotNull] |
|||
public List<ReactionDefinition> Reactions { get; } = new(); |
|||
|
|||
public ReactionEntityTypeDefinition( |
|||
[NotNull] string entityType, |
|||
[NotNull] IEnumerable<ReactionDefinition> reactions, |
|||
IEnumerable<string> createPolicies = null, |
|||
IEnumerable<string> updatePolicies = null, |
|||
IEnumerable<string> deletePolicies = null) : base(entityType, createPolicies, updatePolicies, deletePolicies) |
|||
{ |
|||
Reactions = Check.NotNull(reactions, nameof(reactions)).ToList(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue