Skip to content

Commit

Permalink
Merge pull request #120 from jxnkwlp/feature/code-format
Browse files Browse the repository at this point in the history
🎨 format and fix code warning
  • Loading branch information
jxnkwlp authored Sep 1, 2024
2 parents 3ca98e7 + 18e055c commit 4dd5391
Show file tree
Hide file tree
Showing 70 changed files with 128 additions and 215 deletions.
14 changes: 9 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,15 @@ roslynator_compiler_diagnostic_fixes.enabled = true
# roslynator_compiler_diagnostic_fix.<COMPILER_DIAGNOSTIC_ID>.enabled = true|false
# dotnet_diagnostic.<ANALYZER_ID>.severity = default|none|silent|suggestion|warning|error

dotnet_diagnostic.CA1305.severity = silent
dotnet_diagnostic.CA1310.severity = suggestion
dotnet_diagnostic.CA1848.severity = silent
dotnet_diagnostic.CA1863.severity = suggestion
dotnet_diagnostic.Ca2016.severity = warning
dotnet_diagnostic.ca2254.severity = silent
dotnet_diagnostic.IDE0011.severity = suggestion
dotnet_diagnostic.IDE0060.severity = silent
dotnet_diagnostic.RCS1093.severity = suggestion
dotnet_diagnostic.RCS1163.severity = silent
dotnet_diagnostic.RCS1251.severity = none
dotnet_diagnostic.CA1848.severity = silent
dotnet_diagnostic.CA1305.severity = silent
dotnet_diagnostic.ide0011.severity = warning
dotnet_diagnostic.RCS1251.severity = silent
dotnet_diagnostic.ide0011.severity = silent
dotnet_diagnostic.ca2254.severity = silent
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace Passingwind.WorkflowApp.ApiKeys;

public interface IApiKeyAppService : ICrudAppService<ApiKeyDto, Guid, ApiKeyListRequestDto, ApiKeyCreateOrUpdateDto, ApiKeyCreateOrUpdateDto>, IApplicationService
public interface IApiKeyAppService : ICrudAppService<ApiKeyDto, Guid, ApiKeyListRequestDto, ApiKeyCreateOrUpdateDto, ApiKeyCreateOrUpdateDto>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ public override void Define(IPermissionDefinitionContext context)
{
var settings = context.GetGroupOrNull(SettingManagementPermissions.GroupName);

if (settings != null)
{
settings.AddPermission(OAuth2SettingsPermissions.OAuth2, L("Permission:OAuth2"));
}
settings?.AddPermission(OAuth2SettingsPermissions.OAuth2, L("Permission:OAuth2"));
}

private static LocalizableString L(string name)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Passingwind.WorkflowApp.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Abp.Authorization.Permissions;

namespace Passingwind.WorkflowApp.Permissions;

Expand All @@ -12,9 +10,4 @@ public override void Define(IPermissionDefinitionContext context)
//Define your own permissions here. Example:
//myGroup.AddPermission(WorkflowAppPermissions.MyPermission1, L("Permission:MyPermission1"));
}

private static LocalizableString L(string name)
{
return LocalizableString.Create<WorkflowAppResource>(name);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Passingwind.WorkflowApp.SettingManagement;
namespace Passingwind.WorkflowApp.SettingManagement;
public class OAuth2SettingsDto
{
public bool Enabled { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ namespace Passingwind.WorkflowApp.Localization;
[LocalizationResourceName("WorkflowApp")]
public class WorkflowAppResource
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ public override void PreConfigureServices(ServiceConfigurationContext context)

public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<WorkflowAppDomainSharedModule>();
});
Configure<AbpVirtualFileSystemOptions>(options => options.FileSets.AddEmbedded<WorkflowAppDomainSharedModule>());

Configure<AbpLocalizationOptions>(options =>
{
Expand All @@ -48,9 +45,6 @@ public override void ConfigureServices(ServiceConfigurationContext context)
options.DefaultResourceType = typeof(WorkflowAppResource);
});

Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("WorkflowApp", typeof(WorkflowAppResource));
});
Configure<AbpExceptionLocalizationOptions>(options => options.MapCodeNamespace("WorkflowApp", typeof(WorkflowAppResource)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ public Task<string> GenerateSecretAsync(ApiKey key)
return apiKey.UserId;
}
}
else
else if (Guid.TryParse(userIdString, out Guid userId2))
{
if (Guid.TryParse(userIdString, out Guid userId2))
return userId2;
return userId2;
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ public interface IApiKeyRepository : IRepository<ApiKey, Guid>
Task<List<ApiKey>> GetListAsync(Guid userId, bool includeDetails = false, CancellationToken cancellationToken = default);

Task<List<ApiKey>> GetPagedListAsync(int skipCount, int maxResultCount, Guid userId, string sorting, bool includeDetails = false, CancellationToken cancellationToken = default);

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task MigrateAsync()
await MigrateDatabaseSchemaAsync();
await SeedDataAsync();

Logger.LogInformation($"Successfully completed host database migrations.");
Logger.LogInformation("Successfully completed host database migrations.");

var tenants = await _tenantRepository.GetListAsync(includeDetails: true);

Expand All @@ -64,8 +64,8 @@ public async Task MigrateAsync()
if (tenant.ConnectionStrings.Any())
{
var tenantConnectionStrings = tenant.ConnectionStrings
.Select(x => x.Value)
.ToList();
.ConvertAll(x => x.Value)
;

if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings))
{
Expand Down Expand Up @@ -127,10 +127,8 @@ private bool AddInitialMigrationIfNotExist()
AddInitialMigration();
return true;
}
else
{
return false;
}

return false;
}
catch (Exception e)
{
Expand Down Expand Up @@ -208,7 +206,7 @@ private string GetSolutionDirectoryPath()
{
currentDirectory = Directory.GetParent(currentDirectory.FullName);

if (Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null)
if (Directory.GetFiles(currentDirectory.FullName).Any(f => f.EndsWith(".sln")))
{
return currentDirectory.FullName;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Passingwind.WorkflowApp.Settings;
public class OAuth2Setting
public static class OAuth2Setting
{
private const string Prefix = "OAuth2";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

public static class WorkflowAppSettings
{
private const string Prefix = "WorkflowApp";

//Add your own setting names here. Example:
//public const string MySetting1 = Prefix + ".MySetting1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ public class WorkflowAppDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
Configure<AbpMultiTenancyOptions>(options => options.IsEnabled = MultiTenancyConsts.IsEnabled);

#if DEBUG
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,25 @@ public class WorkflowAppDbContext :

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


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

protected override void OnModelCreating(ModelBuilder builder)
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(builder);
base.OnModelCreating(modelBuilder);

/* Include modules to your migration db context */

builder.ConfigurePermissionManagement();
builder.ConfigureSettingManagement();
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement();
builder.ConfigureElsaModule();
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureBackgroundJobs();
modelBuilder.ConfigureAuditLogging();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureFeatureManagement();
modelBuilder.ConfigureTenantManagement();
modelBuilder.ConfigureElsaModule();

/* Configure your own tables/entities inside here */

Expand All @@ -92,7 +91,7 @@ protected override void OnModelCreating(ModelBuilder builder)
// //...
//});

builder.Entity<ApiKey>(b =>
modelBuilder.Entity<ApiKey>(b =>
{
b.ToTable(WorkflowAppConsts.DbTablePrefix + "ApiKeys", WorkflowAppConsts.DbSchema);
b.ConfigureByConvention();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Initial : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Add_Elsa : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Update_Elsa_1 : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Update_Elsa_2 : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Update_Elsa_3 : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Update_Elsa_4 : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Update_Elsa_5 : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Update_GlobalVariable_2 : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

public partial class Add_ApiKey : Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Demo.Migrations;

/// <inheritdoc />
Expand Down
Loading

0 comments on commit 4dd5391

Please sign in to comment.