@ -5,6 +5,7 @@ using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy ;
using Volo.Abp.MultiTenancy ;
using Volo.Abp.Users ;
using Volo.Abp.Users ;
using Volo.CmsKit.Comments ;
using Volo.CmsKit.Comments ;
using Volo.CmsKit.Contents ;
using Volo.CmsKit.Ratings ;
using Volo.CmsKit.Ratings ;
using Volo.CmsKit.Reactions ;
using Volo.CmsKit.Reactions ;
using Volo.CmsKit.Users ;
using Volo.CmsKit.Users ;
@ -20,7 +21,7 @@ namespace Volo.CmsKit
private readonly ReactionManager _ reactionManager ;
private readonly ReactionManager _ reactionManager ;
private readonly IRatingRepository _ ratingRepository ;
private readonly IRatingRepository _ ratingRepository ;
private readonly ICurrentTenant _ currentTenant ;
private readonly ICurrentTenant _ currentTenant ;
private readonly IContentRepository _ contentRepository ;
public CmsKitDataSeedContributor (
public CmsKitDataSeedContributor (
IGuidGenerator guidGenerator ,
IGuidGenerator guidGenerator ,
ICmsUserRepository cmsUserRepository ,
ICmsUserRepository cmsUserRepository ,
@ -28,7 +29,8 @@ namespace Volo.CmsKit
ICommentRepository commentRepository ,
ICommentRepository commentRepository ,
ReactionManager reactionManager ,
ReactionManager reactionManager ,
IRatingRepository ratingRepository ,
IRatingRepository ratingRepository ,
ICurrentTenant currentTenant )
ICurrentTenant currentTenant ,
IContentRepository contentRepository )
{
{
_ guidGenerator = guidGenerator ;
_ guidGenerator = guidGenerator ;
_ cmsUserRepository = cmsUserRepository ;
_ cmsUserRepository = cmsUserRepository ;
@ -37,6 +39,7 @@ namespace Volo.CmsKit
_ reactionManager = reactionManager ;
_ reactionManager = reactionManager ;
_ ratingRepository = ratingRepository ;
_ ratingRepository = ratingRepository ;
_ currentTenant = currentTenant ;
_ currentTenant = currentTenant ;
_ contentRepository = contentRepository ;
}
}
public async Task SeedAsync ( DataSeedContext context )
public async Task SeedAsync ( DataSeedContext context )
@ -50,6 +53,8 @@ namespace Volo.CmsKit
await SeedReactionsAsync ( ) ;
await SeedReactionsAsync ( ) ;
await SeedRatingsAsync ( ) ;
await SeedRatingsAsync ( ) ;
await SeedContentsAsync ( ) ;
}
}
}
}
@ -177,5 +182,25 @@ namespace Volo.CmsKit
_ cmsKitTestData . User2Id
_ 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 ) ;
}
}
}
}
}