Skip to content

Commit

Permalink
feat : 修改nuget版本号,删除部分不必要的实现,推送到nuget的实现,自动注入和模块化拆为单独的类库
Browse files Browse the repository at this point in the history
  • Loading branch information
KawhiWei committed Aug 16, 2023
1 parent a3edaa2 commit ca3c7d3
Show file tree
Hide file tree
Showing 34 changed files with 85 additions and 129 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Luck.Framework
+ ## change 2.0.1 version
+ ### Update
+ **1、Luck.DDD.Domain**
+ Domain层中的基础聚合根和实体修改命名空间;
+ ### Remove
+ **1、Luck.EntityFrameworkCore**
+ 删除EntityFrameworkCore层中使用的MediatR实现的领域事件,由业务控制,不在基础框架内封装;
+ **2、Luck.DDD.Domain**
+ 删除MediatR实现的领域事件通知;
+ ## change 2.0.0 version
+ ### Add
+ **1、Luck.AppModule**
Expand Down
2 changes: 2 additions & 0 deletions sample/Module.Sample/Domain/Order.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Luck.DDD.Domain;
using Luck.DDD.Domain.Domain.AggregateRoots;
using Luck.DDD.Domain.Domain.Entities;

namespace Module.Sample.Domain
{
Expand Down
2 changes: 1 addition & 1 deletion sample/Module.Sample/Services/OrderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task CreateAndEventAsync()
{
var order = new Order("asdasdsa", "asdasdadas");
_aggregateRootRepository.Add(order);
order.AddDomainEvent(new OrderCreatedEto() { Id = order.Id, Name = order.Name });
//order.AddDomainEvent(new OrderCreatedEto() { Id = order.Id, Name = order.Name });
_logger?.LogInformation("调用了CreateAndEventAsync()方法");
await _unitOfWork.CommitAsync();
//await _cache.AddAsync("order_a1", order);
Expand Down
2 changes: 1 addition & 1 deletion src/common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
Expand Down
2 changes: 1 addition & 1 deletion src/framework/Luck.AppModule/Luck.AppModule.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Luck.AutoDependencyInjection
/// <summary>
/// 自动注入模块,继承与AppModuleBase类进行实现
/// </summary>
public class AutoDependencyAppModule : Luck.AppModule.LuckAppModule
public class AutoDependencyAppModule : LuckAppModule
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
7 changes: 7 additions & 0 deletions src/framework/Luck.AutoDependencyInjection/build_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
echo "请输入NUGET_API_KEY"
read NUGET_API_KEY
rm bin/Release/*.nupkg
dotnet build -c Release
dotnet pack -c Release
dotnet nuget push bin/Release/*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

namespace Luck.DDD.Domain.Domain.AggregateRoots
{
public class AggregateRootBase : IAggregateRootBase
{
private string? _aggregateRootType;


private string AggregateRootName
{
get
{
var aggregateRootType = GetType();
_aggregateRootType = aggregateRootType.FullName;
if (_aggregateRootType is null)
{
throw new ArgumentNullException(nameof(_aggregateRootType));
}

return _aggregateRootType;
}
}

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Luck.DDD.Domain
namespace Luck.DDD.Domain.Domain.AggregateRoots
{
public class AggregateRootWithIdentity<TKey> : AggregateRootBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

using Luck.Framework.Infrastructure;

using Luck.Framework;
using Luck.Framework.Infrastructure;

namespace Luck.DDD.Domain
namespace Luck.DDD.Domain.Domain.AggregateRoots
{
public class FullAggregateRoot : AggregateRootWithIdentity<string>, IUpdatable, ISoftDeletable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Luck.DDD.Domain
namespace Luck.DDD.Domain.Domain.AggregateRoots
{
public interface IAggregateRootBase : IEntity
{
Expand Down
11 changes: 11 additions & 0 deletions src/framework/Luck.DDD.Domain/Domain/Entities/Entity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

using Luck.DDD.Domain.Domain.Entities;

namespace Luck.DDD.Domain.Domian.Entities
{
public abstract class Entity : IEntityWithIdentity
{


}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Luck.DDD.Domain
using Luck.DDD.Domain.Domian.Entities;

namespace Luck.DDD.Domain.Domain.Entities
{
public abstract class EntityWithIdentity<TIdentityKey> : Entity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Luck.Framework;
using Luck.Framework.Infrastructure;
using Luck.Framework.Infrastructure;

namespace Luck.DDD.Domain
namespace Luck.DDD.Domain.Domain.Entities
{
public abstract class FullEntity : EntityWithIdentity<string>, IUpdatable, ISoftDeletable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Luck.DDD.Domain
namespace Luck.DDD.Domain.Domain.Entities
{
public interface IEntityWithIdentity :IEntity

Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions src/framework/Luck.DDD.Domain/Domian/Entities/Entity.cs

This file was deleted.

13 changes: 0 additions & 13 deletions src/framework/Luck.DDD.Domain/Domian/Events/IDomainEvents.cs

This file was deleted.

4 changes: 0 additions & 4 deletions src/framework/Luck.DDD.Domain/Luck.DDD.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="12.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Luck.Framework\Luck.Framework.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq.Expressions;
using Luck.DDD.Domain.Domain.AggregateRoots;

namespace Luck.DDD.Domain.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Luck.DDD.Domain.Repositories
using Luck.DDD.Domain.Domain.AggregateRoots;

namespace Luck.DDD.Domain.Repositories
{
public interface IAggregateRootRepository<TEntity, TKey> :
IWriteRepository<TEntity, TKey>, IRepository<TEntity, TKey> where TEntity : IAggregateRootBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Luck.DDD.Domain.Repositories
using Luck.DDD.Domain.Domain.Entities;

namespace Luck.DDD.Domain.Repositories
{
public interface IEntityRepository<TEntity, TKey> :
IRepository<TEntity, TKey> where TEntity : IEntityWithIdentity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Luck.DDD.Domain.Domain.AggregateRoots;

namespace Luck.DDD.Domain.SqlRepositories;

public interface ISqlAggregateRootRepository<TEntity, TKey>:ISqlWriteRepository<TEntity, TKey>,ISqlRepository<TEntity, TKey>where TEntity : IAggregateRootBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Luck.DDD.Domain.Domain.Entities;

namespace Luck.DDD.Domain.SqlRepositories;

public interface ISqlEntityRepository<TEntity, in TKey> :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Data;
using Luck.DDD.Domain.Domain.AggregateRoots;

namespace Luck.DDD.Domain.SqlRepositories;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Data;
using Luck.Dapper.DbConnectionFactories;
using Luck.DDD.Domain;
using Luck.DDD.Domain.Domain.AggregateRoots;
using Luck.DDD.Domain.SqlRepositories;

namespace Luck.Dapper.Repositories;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Luck.Dapper.DbConnectionFactories;
using Luck.DDD.Domain;
using Luck.DDD.Domain.Domain.Entities;
using Luck.DDD.Domain.SqlRepositories;

namespace Luck.Dapper.Repositories;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Luck.EntityFrameworkCore.DbContexts;
using Microsoft.EntityFrameworkCore;
using System.Linq.Expressions;
using Luck.DDD.Domain.Domain.AggregateRoots;

namespace Luck.EntityFrameworkCore.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Luck.EntityFrameworkCore.DbContexts;
using Microsoft.EntityFrameworkCore;
using System.Linq.Expressions;
using Luck.DDD.Domain.Domain.Entities;

namespace Luck.EntityFrameworkCore.Repositories
{
Expand Down

0 comments on commit ca3c7d3

Please sign in to comment.