From 97d757e5a13367656a439fec1e5379ecc00f46ab Mon Sep 17 00:00:00 2001 From: damon Date: Thu, 7 Mar 2024 23:57:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contexts/AbstractDatabaseModelBuilder.cs | 19 +-------- .../RelationalDatabaseModelBuilder.cs | 39 +++++++------------ .../Identity/UserInitializeUseCase.cs | 3 +- 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/Source/Starfish.Service/Repository/Contexts/AbstractDatabaseModelBuilder.cs b/Source/Starfish.Service/Repository/Contexts/AbstractDatabaseModelBuilder.cs index 4f1b827..1e98c53 100644 --- a/Source/Starfish.Service/Repository/Contexts/AbstractDatabaseModelBuilder.cs +++ b/Source/Starfish.Service/Repository/Contexts/AbstractDatabaseModelBuilder.cs @@ -9,30 +9,15 @@ public virtual void Configure(ModelBuilder modelBuilder) { ConfigureUser(modelBuilder); ConfigureTeam(modelBuilder); - ConfigureTeamMember(modelBuilder); ConfigureConfiguration(modelBuilder); - ConfigureConfigurationItem(modelBuilder); - ConfigureConfigurationArchive(modelBuilder); - ConfigureConfigurationRevision(modelBuilder); - ConfigureToken(modelBuilder); - ConfigureOperationLog(modelBuilder); + ConfigureSupported(modelBuilder); } protected abstract ModelBuilder ConfigureUser(ModelBuilder modelBuilder); protected abstract ModelBuilder ConfigureTeam(ModelBuilder modelBuilder); - protected abstract ModelBuilder ConfigureTeamMember(ModelBuilder modelBuilder); - protected abstract ModelBuilder ConfigureConfiguration(ModelBuilder modelBuilder); - protected abstract ModelBuilder ConfigureConfigurationItem(ModelBuilder modelBuilder); - - protected abstract ModelBuilder ConfigureConfigurationArchive(ModelBuilder modelBuilder); - - protected abstract ModelBuilder ConfigureConfigurationRevision(ModelBuilder modelBuilder); - - protected abstract ModelBuilder ConfigureToken(ModelBuilder modelBuilder); - - protected abstract ModelBuilder ConfigureOperationLog(ModelBuilder modelBuilder); + protected abstract ModelBuilder ConfigureSupported(ModelBuilder modelBuilder); } \ No newline at end of file diff --git a/Source/Starfish.Service/Repository/Contexts/RelationalDatabaseModelBuilder.cs b/Source/Starfish.Service/Repository/Contexts/RelationalDatabaseModelBuilder.cs index 7b7a124..3d0e0bb 100644 --- a/Source/Starfish.Service/Repository/Contexts/RelationalDatabaseModelBuilder.cs +++ b/Source/Starfish.Service/Repository/Contexts/RelationalDatabaseModelBuilder.cs @@ -34,7 +34,7 @@ protected override ModelBuilder ConfigureUser(ModelBuilder modelBuilder) protected override ModelBuilder ConfigureTeam(ModelBuilder modelBuilder) { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("team"); entity.HasKey(t => t.Id); @@ -50,11 +50,8 @@ protected override ModelBuilder ConfigureTeam(ModelBuilder modelBuilder) .WithOne(t => t.Team) .HasForeignKey(t => t.TeamId); }); - } - protected override ModelBuilder ConfigureTeamMember(ModelBuilder modelBuilder) - { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("team_member"); entity.HasKey(t => t.Id); @@ -74,11 +71,13 @@ protected override ModelBuilder ConfigureTeamMember(ModelBuilder modelBuilder) .WithMany() .HasForeignKey(t => t.UserId); }); + + return modelBuilder; } protected override ModelBuilder ConfigureConfiguration(ModelBuilder modelBuilder) { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("configuration"); @@ -110,11 +109,8 @@ protected override ModelBuilder ConfigureConfiguration(ModelBuilder modelBuilder .HasForeignKey() .OnDelete(DeleteBehavior.Cascade); }); - } - protected override ModelBuilder ConfigureConfigurationItem(ModelBuilder modelBuilder) - { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("configuration_item"); @@ -133,11 +129,8 @@ protected override ModelBuilder ConfigureConfigurationItem(ModelBuilder modelBui .HasForeignKey(t => t.ConfigurationId) .OnDelete(DeleteBehavior.Cascade); }); - } - protected override ModelBuilder ConfigureConfigurationArchive(ModelBuilder modelBuilder) - { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("configuration_archive"); @@ -150,11 +143,8 @@ protected override ModelBuilder ConfigureConfigurationArchive(ModelBuilder model .WithOne(t => t.Archive) .OnDelete(DeleteBehavior.Cascade); }); - } - protected override ModelBuilder ConfigureConfigurationRevision(ModelBuilder modelBuilder) - { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("configuration_revision"); @@ -171,11 +161,13 @@ protected override ModelBuilder ConfigureConfigurationRevision(ModelBuilder mode .HasForeignKey(t => t.ConfigurationId) .OnDelete(DeleteBehavior.Cascade); }); + + return modelBuilder; } - protected override ModelBuilder ConfigureToken(ModelBuilder modelBuilder) + protected override ModelBuilder ConfigureSupported(ModelBuilder modelBuilder) { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("token"); @@ -188,11 +180,8 @@ protected override ModelBuilder ConfigureToken(ModelBuilder modelBuilder) .IsRequired() .HasValueGenerator(); }); - } - protected override ModelBuilder ConfigureOperationLog(ModelBuilder modelBuilder) - { - return modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.ToTable("operate_log"); @@ -206,5 +195,7 @@ protected override ModelBuilder ConfigureOperationLog(ModelBuilder modelBuilder) .IsRequired() .HasValueGenerator(); }); + + return modelBuilder; } } \ No newline at end of file diff --git a/Source/Starfish.Service/UseCases/Identity/UserInitializeUseCase.cs b/Source/Starfish.Service/UseCases/Identity/UserInitializeUseCase.cs index bf41a8f..8194899 100644 --- a/Source/Starfish.Service/UseCases/Identity/UserInitializeUseCase.cs +++ b/Source/Starfish.Service/UseCases/Identity/UserInitializeUseCase.cs @@ -43,6 +43,7 @@ public async Task ExecuteAsync(CancellationToken cancellationToken = default) IsAdmin = true, Reserved = true }; - await _bus.SendAsync(command, cancellationToken).ContinueWith(task => task.WaitAndUnwrapException()); + await _bus.SendAsync(command, cancellationToken) + .ContinueWith(task => task.WaitAndUnwrapException(), cancellationToken); } } \ No newline at end of file From b1956196b0b85167ea037abd9e91a9b011d2a2bf Mon Sep 17 00:00:00 2001 From: damon Date: Thu, 7 Mar 2024 23:58:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E9=85=8D=E7=BD=AE=E6=96=87=E6=A1=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Starfish.Client/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Starfish.Client/README.md b/Source/Starfish.Client/README.md index 5e40d79..2b92135 100644 --- a/Source/Starfish.Client/README.md +++ b/Source/Starfish.Client/README.md @@ -35,9 +35,8 @@ in `appsettings.json` { "Starfish": { "Host": "http://localhost:5000", - "App": "Starfish.Sample.Blazor", - "Secret": "123456", - "Env": "Development" + "Id": "5lNc9zQGdG7", + "Secret": "123456" } } ``` From 1e47c98416def1da4700d10c46604f1e9b20ccab Mon Sep 17 00:00:00 2001 From: damon Date: Fri, 8 Mar 2024 00:00:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.props b/global.props index a74110a..a0a653a 100644 --- a/global.props +++ b/global.props @@ -1,6 +1,6 @@ - 1.0.3 + 1.0.4 damon Nerosoft Ltd. Starfish