mirror of https://github.com/abpframework/abp.git
10 changed files with 2561 additions and 1196 deletions
File diff suppressed because it is too large
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace Volo.CmsKit.Migrations |
|||
{ |
|||
public partial class Rating_Added : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "CmsRatings", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(nullable: false), |
|||
Star = table.Column<short>(nullable: false), |
|||
CreationTime = table.Column<DateTime>(nullable: false), |
|||
CreatorId = table.Column<Guid>(nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_CmsRatings", x => x.Id); |
|||
}); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "CmsRatings"); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,18 @@ |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.GlobalFeatures; |
|||
|
|||
namespace Volo.CmsKit.GlobalFeatures |
|||
{ |
|||
[GlobalFeatureName(Name)] |
|||
public class RatingsFeature : GlobalFeature |
|||
{ |
|||
public const string Name = "CmsKit.Ratings"; |
|||
|
|||
internal RatingsFeature( |
|||
[NotNull] GlobalCmsKitFeatures cmsKit |
|||
) : base(cmsKit) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Volo.CmsKit.Ratings |
|||
{ |
|||
public interface IRatingRepository : IBasicRepository<Rating, Guid> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Auditing; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace Volo.CmsKit.Ratings |
|||
{ |
|||
public class Rating : BasicAggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator |
|||
{ |
|||
public virtual short Star { get; protected set; } |
|||
|
|||
public virtual DateTime CreationTime { get; set; } |
|||
|
|||
public virtual Guid CreatorId { get; set; } |
|||
|
|||
protected Rating() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public Rating( |
|||
Guid id, |
|||
[NotNull] short star, |
|||
Guid creatorId |
|||
) |
|||
: base(id) |
|||
{ |
|||
Star = star; |
|||
CreatorId = creatorId; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.CmsKit.EntityFrameworkCore; |
|||
|
|||
namespace Volo.CmsKit.Ratings |
|||
{ |
|||
public class EfCoreRatingRepository : EfCoreRepository<ICmsKitDbContext, Rating, Guid>, IRatingRepository |
|||
{ |
|||
public EfCoreRatingRepository(IDbContextProvider<ICmsKitDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue