Created content-test-data

pull/6858/head
Ahmet 5 years ago
parent 2cf68eed2e
commit 8845c81a6d

@ -5,6 +5,7 @@ using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Users;
using Volo.CmsKit.Comments;
using Volo.CmsKit.Contents;
using Volo.CmsKit.Ratings;
using Volo.CmsKit.Reactions;
using Volo.CmsKit.Users;
@ -20,7 +21,7 @@ namespace Volo.CmsKit
private readonly ReactionManager _reactionManager;
private readonly IRatingRepository _ratingRepository;
private readonly ICurrentTenant _currentTenant;
private readonly IContentRepository _contentRepository;
public CmsKitDataSeedContributor(
IGuidGenerator guidGenerator,
ICmsUserRepository cmsUserRepository,
@ -28,7 +29,8 @@ namespace Volo.CmsKit
ICommentRepository commentRepository,
ReactionManager reactionManager,
IRatingRepository ratingRepository,
ICurrentTenant currentTenant)
ICurrentTenant currentTenant,
IContentRepository contentRepository)
{
_guidGenerator = guidGenerator;
_cmsUserRepository = cmsUserRepository;
@ -37,6 +39,7 @@ namespace Volo.CmsKit
_reactionManager = reactionManager;
_ratingRepository = ratingRepository;
_currentTenant = currentTenant;
_contentRepository = contentRepository;
}
public async Task SeedAsync(DataSeedContext context)
@ -50,6 +53,8 @@ namespace Volo.CmsKit
await SeedReactionsAsync();
await SeedRatingsAsync();
await SeedContentsAsync();
}
}
@ -177,5 +182,25 @@ namespace Volo.CmsKit
_cmsKitTestData.User2Id
));
}
private async Task SeedContentsAsync()
{
var content1 = new Content(
_guidGenerator.Create(),
_cmsKitTestData.Content_1_EntityType,
_cmsKitTestData.Content_1_Id,
_cmsKitTestData.Content_1
);
var content2 = new Content(
_guidGenerator.Create(),
_cmsKitTestData.Content_2_EntityType,
_cmsKitTestData.Content_2_Id,
_cmsKitTestData.Content_2
);
await _contentRepository.InsertAsync(content1);
await _contentRepository.InsertAsync(content2);
}
}
}

@ -18,5 +18,17 @@ namespace Volo.CmsKit
public string EntityId1 { get; } = "1";
public string EntityId2 { get; } = "2";
public string Content_1_EntityType = "Lyrics";
public string Content_1 { get; } = "First things first\nI'ma say all the words inside my head\nI'm fired up and tired of the way that things have been, oh-ooh\nThe way that things have been, oh-ooh";
public string Content_1_Id = "1";
public string Content_2_EntityType = "LyricsAlso";
public string Content_2 { get; } = "Second thing second\nDon't you tell me what you think that I could be\nI'm the one at the sail, I'm the master of my sea, oh-ooh\nThe master of my sea, oh-ooh";
public string Content_2_Id = "2";
}
}

Loading…
Cancel
Save