Skip to content

Commit

Permalink
🎨 format and clear code
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnkwlp committed Sep 16, 2023
1 parent 0f0bd6d commit 731c0d1
Show file tree
Hide file tree
Showing 240 changed files with 992 additions and 1,764 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ namespace Passingwind.WorkflowApp.Permissions;
public static class OAuth2SettingsPermissions
{
public const string OAuth2 = SettingManagementPermissions.GroupName + ".OAuth2";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace Passingwind.WorkflowApp.SettingManagement;
public class OAuth2SettingsDto
{
public bool Enabled { get; set; }
public string DisplayName { get; set; }
public string Authority { get; set; }
public string MetadataAddress { get; set; }
public bool Enabled { get; set; }
public string DisplayName { get; set; }
public string Authority { get; set; }
public string MetadataAddress { get; set; }
public string ClientId { get; set; }
public string ClientSecret { get; set; }
public string Scope { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ public interface IExternalLoginProviderManager : ITransientDependency

Task RegisterOpenIdConnectAsync(string provider, string displayName, Action<OpenIdConnectOptions> configure);
Task UnRegisterOpenIdConnectAsync(string provider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ public async Task<PagedResultDto<ApiKeyDto>> GetListAsync(ApiKeyListRequestDto i
var list = await _repository.GetPagedListAsync(input.SkipCount, input.MaxResultCount, userId, nameof(ApiKey.CreationTime) + " desc");

var result = ObjectMapper.Map<List<ApiKey>, List<ApiKeyDto>>(list);
result.ForEach(x =>
{
x.Secret = null;
});
result.ForEach(x => x.Secret = null);

return new PagedResultDto<ApiKeyDto>(count, result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public OAuth2SettingsAppService(ISettingManager settingManager, ISettingProvider

public async Task<OAuth2SettingsDto> GetAsync()
{
OAuth2SettingsDto result = new OAuth2SettingsDto()
return new OAuth2SettingsDto()
{
Enabled = await _settingProvider.GetAsync<bool>(OAuth2Setting.Enabled),
DisplayName = await _settingProvider.GetOrNullAsync(OAuth2Setting.DisplayName),
Expand All @@ -36,8 +36,6 @@ public async Task<OAuth2SettingsDto> GetAsync()
ClientSecret = await _settingProvider.GetOrNullAsync(OAuth2Setting.ClientSecret),
Scope = await _settingProvider.GetOrNullAsync(OAuth2Setting.Scope),
};

return result;
}

public async Task UpdateAsync(OAuth2SettingUpdateDto input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public class WorkflowAppApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<WorkflowAppApplicationModule>();
});
Configure<AbpAutoMapperOptions>(options => options.AddMaps<WorkflowAppApplicationModule>());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = await AbpApplicationFactory.CreateAsync<WorkflowAppDbMigratorModule>(options =>
{
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
}))
{
await application.InitializeAsync();
Expand Down
2 changes: 1 addition & 1 deletion app/src/Passingwind.WorkflowApp.DbMigrator/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ public async Task<List<ApiKey>> GetPagedListAsync(int skipCount, int maxResultCo
.PageBy(skipCount, maxResultCount)
.ToListAsync(cancellationToken);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Passingwind.Abp.ElsaModule.EntityFrameworkCore;
using Passingwind.WorkflowApp.ApiKeys;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
Expand Down Expand Up @@ -40,7 +40,9 @@ public class WorkflowAppDbContext :
* uses this DbContext on runtime. Otherwise, it will use its own DbContext class.
*/

//Identity
/// <summary>
/// Identity
/// </summary>
public DbSet<IdentityUser> Users { get; set; }
public DbSet<IdentityRole> Roles { get; set; }
public DbSet<IdentityClaimType> ClaimTypes { get; set; }
Expand All @@ -49,18 +51,19 @@ public class WorkflowAppDbContext :
public DbSet<IdentityLinkUser> LinkUsers { get; set; }
public DbSet<IdentityUserDelegation> UserDelegations { get; set; }

// Tenant Management
/// <summary>
/// Tenant Management
/// </summary>
public DbSet<Tenant> Tenants { get; set; }
public DbSet<TenantConnectionString> TenantConnectionStrings { get; set; }

#endregion
#endregion Entities from the modules

public DbSet<ApiKey> ApiKeys { get; set; }

public WorkflowAppDbContext(DbContextOptions<WorkflowAppDbContext> options)
: base(options)
{

}

protected override void OnModelCreating(ModelBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public override void ConfigureServices(ServiceConfigurationContext context)
/* The main point to change your DBMS.
* See also DemoMigrationsDbContextFactory for EF Core tooling. */
options.UseSqlServer();
});

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpAuditLogs", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpBackgroundJobs",
Expand All @@ -59,10 +56,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpClaimTypes",
Expand All @@ -79,10 +73,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpClaimTypes", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpFeatureValues",
Expand All @@ -94,10 +85,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpFeatureValues", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpLinkUsers",
Expand All @@ -109,10 +97,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
TargetUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TargetTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpLinkUsers", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpLinkUsers", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpOrganizationUnits",
Expand Down Expand Up @@ -153,10 +138,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpRoles",
Expand All @@ -172,10 +154,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpRoles", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpSecurityLogs",
Expand All @@ -197,10 +176,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpSettings",
Expand All @@ -212,10 +188,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpSettings", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpTenants",
Expand All @@ -233,10 +206,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpTenants", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpTenants", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpUsers",
Expand Down Expand Up @@ -271,10 +241,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AbpUsers", x => x.Id));

migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ElsaBookmarks", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_ElsaBookmarks", x => x.Id));

migrationBuilder.CreateTable(
name: "ElsaTriggers",
Expand All @@ -49,10 +46,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ElsaTriggers", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_ElsaTriggers", x => x.Id));

migrationBuilder.CreateTable(
name: "ElsaWorkflowDefinitions",
Expand Down Expand Up @@ -81,10 +75,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ElsaWorkflowDefinitions", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_ElsaWorkflowDefinitions", x => x.Id));

migrationBuilder.CreateTable(
name: "ElsaWorkflowInstances",
Expand Down Expand Up @@ -123,10 +114,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ElsaWorkflowInstances", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_ElsaWorkflowInstances", x => x.Id));

migrationBuilder.CreateTable(
name: "ElsaWorkflowDefinitionVersions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ElsaGlobalVariables", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_ElsaGlobalVariables", x => x.Id));
}

protected override void Down(MigrationBuilder migrationBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppApiKeys", x => x.Id);
});
constraints: table => table.PrimaryKey("PK_AppApiKeys", x => x.Id));
}

protected override void Down(MigrationBuilder migrationBuilder)
Expand Down
Loading

0 comments on commit 731c0d1

Please sign in to comment.