mirror of https://github.com/abpframework/abp.git
18 changed files with 115 additions and 125 deletions
@ -1,35 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace Volo.CmsKit.Tags |
|||
{ |
|||
public class EntityTag : AggregateRoot |
|||
{ |
|||
protected EntityTag() |
|||
{ |
|||
} |
|||
|
|||
public EntityTag(string entityType, string entityId, Guid tagId) |
|||
{ |
|||
EntityType = entityType; |
|||
EntityId = entityId; |
|||
TagId = tagId; |
|||
} |
|||
|
|||
public virtual string EntityType { get; protected set; } |
|||
|
|||
public virtual string EntityId { get; protected set; } |
|||
|
|||
public virtual Guid TagId { get; set; } |
|||
|
|||
public override object[] GetKeys() |
|||
{ |
|||
return new object[] |
|||
{ |
|||
EntityType, |
|||
EntityId, |
|||
TagId |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
@ -1,39 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.CmsKit.EntityTags; |
|||
using Volo.CmsKit.Tags; |
|||
|
|||
namespace Volo.CmsKit.EntityTags |
|||
{ |
|||
public class EntityTagManager : IEntityTagManager |
|||
{ |
|||
private readonly ITagRepository tagRepository; |
|||
private readonly IEntityTagRepository entityTagRepository; |
|||
|
|||
public EntityTagManager( |
|||
ITagRepository tagRepository, |
|||
IEntityTagRepository entityTagRepository) |
|||
{ |
|||
this.tagRepository = tagRepository; |
|||
this.entityTagRepository = entityTagRepository; |
|||
} |
|||
|
|||
public Task AddTagToEntityAsync(Guid tagId, string entityType, string entityId) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public Task<IList<Tag>> GetEntityTagsAsync(string entityType, string entityId) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public Task RemoveTagFromEntityAsync(Guid tagId, string entityType, string entityId) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.CmsKit.Tags; |
|||
|
|||
namespace Volo.CmsKit.EntityTags |
|||
{ |
|||
public interface IEntityTagManager |
|||
{ |
|||
Task AddTagToEntityAsync(Guid tagId, string entityType, string entityId); |
|||
Task RemoveTagFromEntityAsync(Guid tagId, string entityType, string entityId); |
|||
Task<IList<Tag>> GetEntityTagsAsync(string entityType, string entityId); |
|||
} |
|||
} |
|||
@ -1,14 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.CmsKit.Tags; |
|||
|
|||
namespace Volo.CmsKit.EntityTags |
|||
{ |
|||
public interface IEntityTagRepository : IBasicRepository<EntityTag> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Entities; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace Volo.CmsKit.Tags |
|||
{ |
|||
public class EntityTag : Entity, IMultiTenant |
|||
{ |
|||
public virtual Guid TagId { get; set; } |
|||
|
|||
public virtual Guid EntityId { get; set; } |
|||
|
|||
public virtual Guid? TenantId { get; } |
|||
|
|||
protected EntityTag() |
|||
{ |
|||
} |
|||
|
|||
public EntityTag(Guid tagId, Guid entityId, Guid? tenantId = null) |
|||
{ |
|||
TagId = tagId; |
|||
EntityId = entityId; |
|||
TenantId = tenantId; |
|||
} |
|||
|
|||
public override object[] GetKeys() |
|||
{ |
|||
return new object[] { TagId, EntityId, TenantId }; |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Volo.CmsKit.Tags |
|||
{ |
|||
public interface IEntityTagRepository : IBasicRepository<EntityTag> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -1,14 +1,13 @@ |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.CmsKit.EntityFrameworkCore; |
|||
using Volo.CmsKit.Tags; |
|||
|
|||
namespace Volo.CmsKit.EntityTags |
|||
namespace Volo.CmsKit.Tags |
|||
{ |
|||
public class EfCoreEntityTagRepository : EfCoreRepository<ICmsKitDbContext, EntityTag>, IEntityTagRepository |
|||
public class EfCoreEntityTagRepository: EfCoreRepository<ICmsKitDbContext, EntityTag>, IEntityTagRepository |
|||
{ |
|||
public EfCoreEntityTagRepository(IDbContextProvider<ICmsKitDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,14 +1,13 @@ |
|||
using Volo.Abp.Domain.Repositories.MongoDB; |
|||
using Volo.Abp.MongoDB; |
|||
using Volo.CmsKit.EntityTags; |
|||
using Volo.CmsKit.Tags; |
|||
|
|||
namespace Volo.CmsKit.MongoDB.EntityTags |
|||
namespace Volo.CmsKit.MongoDB.Tags |
|||
{ |
|||
public class MongoEntityTagRepository : MongoDbRepository<ICmsKitMongoDbContext, EntityTag>, IEntityTagRepository |
|||
public class MongoEntityTagRepository: MongoDbRepository<ICmsKitMongoDbContext, EntityTag>, IEntityTagRepository |
|||
{ |
|||
public MongoEntityTagRepository(IMongoDbContextProvider<ICmsKitMongoDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue