Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #31

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Source/Starfish.Client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ in `appsettings.json`
{
"Starfish": {
"Host": "http://localhost:5000",
"App": "Starfish.Sample.Blazor",
"Secret": "123456",
"Env": "Development"
"Id": "5lNc9zQGdG7",
"Secret": "123456"
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected override ModelBuilder ConfigureUser(ModelBuilder modelBuilder)

protected override ModelBuilder ConfigureTeam(ModelBuilder modelBuilder)
{
return modelBuilder.Entity<Team>(entity =>
modelBuilder.Entity<Team>(entity =>
{
entity.ToTable("team");
entity.HasKey(t => t.Id);
Expand All @@ -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<TeamMember>(entity =>
modelBuilder.Entity<TeamMember>(entity =>
{
entity.ToTable("team_member");
entity.HasKey(t => t.Id);
Expand All @@ -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<Configuration>(entity =>
modelBuilder.Entity<Configuration>(entity =>
{
entity.ToTable("configuration");

Expand Down Expand Up @@ -110,11 +109,8 @@ protected override ModelBuilder ConfigureConfiguration(ModelBuilder modelBuilder
.HasForeignKey<ConfigurationArchive>()
.OnDelete(DeleteBehavior.Cascade);
});
}

protected override ModelBuilder ConfigureConfigurationItem(ModelBuilder modelBuilder)
{
return modelBuilder.Entity<ConfigurationItem>(entity =>
modelBuilder.Entity<ConfigurationItem>(entity =>
{
entity.ToTable("configuration_item");

Expand All @@ -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<ConfigurationArchive>(entity =>
modelBuilder.Entity<ConfigurationArchive>(entity =>
{
entity.ToTable("configuration_archive");

Expand All @@ -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<ConfigurationRevision>(entity =>
modelBuilder.Entity<ConfigurationRevision>(entity =>
{
entity.ToTable("configuration_revision");

Expand All @@ -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<Token>(entity =>
modelBuilder.Entity<Token>(entity =>
{
entity.ToTable("token");

Expand All @@ -188,11 +180,8 @@ protected override ModelBuilder ConfigureToken(ModelBuilder modelBuilder)
.IsRequired()
.HasValueGenerator<SnowflakeIdValueGenerator>();
});
}

protected override ModelBuilder ConfigureOperationLog(ModelBuilder modelBuilder)
{
return modelBuilder.Entity<OperateLog>(entity =>
modelBuilder.Entity<OperateLog>(entity =>
{
entity.ToTable("operate_log");

Expand All @@ -206,5 +195,7 @@ protected override ModelBuilder ConfigureOperationLog(ModelBuilder modelBuilder)
.IsRequired()
.HasValueGenerator<SnowflakeIdValueGenerator>();
});

return modelBuilder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public async Task ExecuteAsync(CancellationToken cancellationToken = default)
IsAdmin = true,
Reserved = true
};
await _bus.SendAsync<UserCreateCommand, string>(command, cancellationToken).ContinueWith(task => task.WaitAndUnwrapException());
await _bus.SendAsync<UserCreateCommand, string>(command, cancellationToken)
.ContinueWith(task => task.WaitAndUnwrapException(), cancellationToken);
}
}
2 changes: 1 addition & 1 deletion global.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.0.3</Version>
<Version>1.0.4</Version>
<Authors>damon</Authors>
<Company>Nerosoft Ltd.</Company>
<Product>Starfish</Product>
Expand Down
Loading