Skip to content

Commit

Permalink
Merge pull request #7 from NerosoftDev/develop
Browse files Browse the repository at this point in the history
fixes CI build error.
  • Loading branch information
Codespilot authored Dec 22, 2023
2 parents e53a238 + 4dfb970 commit 6152b21
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 60 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ resharper_convert_to_primary_constructor_highlighting = none # 去除构造函

[*.xaml.cs]
resharper_redundant_extends_list_entry_highlighting = none # 去除xaml.cs文件的基类型重复警告。基类型不能删除,否则编译报错。

[*.{cs,vb}]
# Organize usings
#按字母顺序对 System.* using 指令排序,并将它们放在其他 using 指令前面
dotnet_sort_system_directives_first = true
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<EnablePackageVersionOverride>true</EnablePackageVersionOverride>
<EuoniaPackageVersion>8.1.14</EuoniaPackageVersion>
<EuoniaPackageVersion>8.1.15</EuoniaPackageVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Dapper" Version="2.1.24" />
Expand Down
4 changes: 2 additions & 2 deletions Source/Starfish.Service/Domain/Aggregates/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private User(string userName, string passwordHash, string passwordSalt)
/// <returns></returns>
internal static User Create(string userName, string password)
{
var salt = RandomUtility.CreateUniqueId();
var salt = RandomUtility.GenerateUniqueId();
var hash = Cryptography.DES.Encrypt(password, Encoding.UTF8.GetBytes(salt));
var entity = new User(userName, hash, salt);
return entity;
Expand All @@ -118,7 +118,7 @@ internal static User Create(string userName, string password)
/// <param name="password"></param>
internal void ChangePassword(string password)
{
var salt = RandomUtility.CreateUniqueId();
var salt = RandomUtility.GenerateUniqueId();
var hash = Cryptography.DES.Encrypt(password, Encoding.UTF8.GetBytes(salt));
PasswordHash = hash;
PasswordSalt = salt;
Expand Down
10 changes: 2 additions & 8 deletions Source/Starfish.Service/UseCases/Apps/AppInfoDeleteUseCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Nerosoft.Starfish.UseCases;
/// <summary>
/// 应用信息删除用例接口
/// </summary>
public interface IAppInfoDeleteUseCase : IUseCase<AppInfoDeleteInput>;
public interface IAppInfoDeleteUseCase : INonOutputUseCase<AppInfoDeleteInput>;

/// <summary>
/// 应用信息删除输入
Expand All @@ -25,23 +25,17 @@ public class AppInfoDeleteUseCase : IAppInfoDeleteUseCase
/// <summary>
/// 允许访问的角色
/// </summary>
private readonly string[] _roles = { "SA", "RW" };
private readonly string[] _roles = ["SA", "RW"];

private readonly IBus _bus;
private readonly UserPrincipal _user;

/// <summary>
/// 构造函数
/// </summary>
/// <param name="bus"></param>
/// <param name="user"></param>
public AppInfoDeleteUseCase(IBus bus, UserPrincipal user)
{
_bus = bus;
_user = user;
}

/// <inheritdoc />
public Task ExecuteAsync(AppInfoDeleteInput input, CancellationToken cancellationToken = default)
{
if (!_user.IsAuthenticated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Nerosoft.Starfish.UseCases;

public interface IAppInfoSetSecretUseCase : IUseCase<AppInfoSetSecretInput>;
public interface IAppInfoSetSecretUseCase : INonOutputUseCase<AppInfoSetSecretInput>;

public record AppInfoSetSecretInput(long Id, string Secret) : IUseCaseInput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nerosoft.Starfish.UseCases;
/// <summary>
/// 应用信息更新用例接口
/// </summary>
public interface IAppInfoUpdateUseCase : IUseCase<AppInfoUpdateInput>;
public interface IAppInfoUpdateUseCase : INonOutputUseCase<AppInfoUpdateInput>;

/// <summary>
/// 应用信息更新输入
Expand All @@ -32,18 +32,12 @@ public class AppInfoUpdateUseCase : IAppInfoUpdateUseCase
private readonly IBus _bus;
private readonly UserPrincipal _user;

/// <summary>
/// 构造函数
/// </summary>
/// <param name="bus"></param>
/// <param name="user"></param>
public AppInfoUpdateUseCase(IBus bus, UserPrincipal user)
{
_bus = bus;
_user = user;
}

/// <inheritdoc />
public Task ExecuteAsync(AppInfoUpdateInput input, CancellationToken cancellationToken = default)
{
if (!_user.IsAuthenticated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nerosoft.Starfish.UseCases;
/// <summary>
/// 变更应用信息状态用例接口
/// </summary>
public interface IChangeAppInfoStatusUseCase : IUseCase<ChangeAppInfoStatusInput>;
public interface IChangeAppInfoStatusUseCase : INonOutputUseCase<ChangeAppInfoStatusInput>;

/// <summary>
/// 变更应用信息状态输入
Expand All @@ -27,23 +27,17 @@ public class ChangeAppInfoStatusUseCase : IChangeAppInfoStatusUseCase
/// <summary>
/// 允许访问的角色
/// </summary>
private readonly string[] _roles = { "SA", "RW" };
private readonly string[] _roles = ["SA", "RW"];

private readonly IBus _bus;
private readonly UserPrincipal _user;

/// <summary>
/// 构造函数
/// </summary>
/// <param name="bus"></param>
/// <param name="user"></param>
public ChangeAppInfoStatusUseCase(IBus bus, UserPrincipal user)
{
_bus = bus;
_user = user;
}

/// <inheritdoc />
public Task ExecuteAsync(ChangeAppInfoStatusInput input, CancellationToken cancellationToken = default)
{
if (!_user.IsAuthenticated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Nerosoft.Starfish.UseCases;

public interface IUserDeleteUseCase : IUseCase<UserDeleteInput>;
public interface IUserDeleteUseCase : INonOutputUseCase<UserDeleteInput>;

public record UserDeleteInput(int Id) : IUseCaseInput;

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

namespace Nerosoft.Starfish.UseCases;

public interface IUserSetRoleUseCase : IUseCase<UserSetRoleInput>;
public interface IUserSetRoleUseCase : INonOutputUseCase<UserSetRoleInput>;

public record UserSetRoleInput(int Id, List<string> Roles) : IUseCaseInput;

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

namespace Nerosoft.Starfish.UseCases;

public interface IUserUpdateUseCase : IUseCase<UserUpdateInput>;
public interface IUserUpdateUseCase : INonOutputUseCase<UserUpdateInput>;

public record UserUpdateInput(int Id, UserUpdateDto Data) : IUseCaseInput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Nerosoft.Starfish.UseCases;
/// <summary>
/// 删除配置节点用例接口
/// </summary>
public interface ISettingNodeDeleteUseCase : IUseCase<SettingNodeDeleteInput>;
public interface ISettingNodeDeleteUseCase : INonOutputUseCase<SettingNodeDeleteInput>;

/// <summary>
/// 删除配置节点输入
Expand All @@ -22,16 +22,11 @@ public class SettingNodeDeleteUseCase : ISettingNodeDeleteUseCase
{
private readonly IBus _bus;

/// <summary>
/// 构造函数
/// </summary>
/// <param name="bus"></param>
public SettingNodeDeleteUseCase(IBus bus)
{
_bus = bus;
}

/// <inheritdoc />
public Task ExecuteAsync(SettingNodeDeleteInput input, CancellationToken cancellationToken = default)
{
var command = new SettingNodeDeleteCommand(input.Id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using Nerosoft.Euonia.Application;
using Nerosoft.Euonia.Bus;
using Nerosoft.Starfish.Application;
using Nerosoft.Starfish.Domain;
using Nerosoft.Starfish.Transit;

namespace Nerosoft.Starfish.UseCases;

/// <summary>
/// 配置节点发布用例接口
/// </summary>
public interface ISettingNodePublishUseCase : IUseCase<SettingNodePublishInput>;
public interface ISettingNodePublishUseCase : INonOutputUseCase<SettingNodePublishInput>;

/// <summary>
/// 配置节点发布输入
Expand All @@ -23,20 +22,12 @@ public record SettingNodePublishInput(long Id, SettingNodePublishDto Data) : IUs
public class SettingNodePublishUseCase : ISettingNodePublishUseCase
{
private readonly IBus _bus;
private readonly ISettingNodeRepository _repository;

/// <summary>
/// 构造函数
/// </summary>
/// <param name="bus"></param>
/// <param name="repository"></param>
public SettingNodePublishUseCase(IBus bus, ISettingNodeRepository repository)
public SettingNodePublishUseCase(IBus bus)
{
_bus = bus;
_repository = repository;
}

/// <inheritdoc />

public async Task ExecuteAsync(SettingNodePublishInput input, CancellationToken cancellationToken = default)
{
var command = new SettingNodePublishCommand(input.Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Nerosoft.Starfish.UseCases;
/// <summary>
/// 配置节点更新用例接口
/// </summary>
public interface ISettingNodeUpdateDescriptionUseCase : IUseCase<SettingNodeUpdateDescriptionInput>;
public interface ISettingNodeUpdateDescriptionUseCase : INonOutputUseCase<SettingNodeUpdateDescriptionInput>;

/// <summary>
/// 配置节点更新输入
Expand All @@ -23,16 +23,11 @@ public class SettingNodeUpdateDescriptionUseCase : ISettingNodeUpdateDescription
{
private readonly IBus _bus;

/// <summary>
/// 构造函数
/// </summary>
/// <param name="bus"></param>
public SettingNodeUpdateDescriptionUseCase(IBus bus)
{
_bus = bus;
}

/// <inheritdoc />

public Task ExecuteAsync(SettingNodeUpdateDescriptionInput valueInput, CancellationToken cancellationToken = default)
{
var command = new SettingNodeUpdateCommand(valueInput.Id, "description", valueInput.Description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Nerosoft.Starfish.UseCases;
/// <summary>
/// 重命名配置节点用例接口
/// </summary>
public interface ISettingNodeUpdateNameUseCase : IUseCase<SettingNodeUpdateNameInput>;
public interface ISettingNodeUpdateNameUseCase : INonOutputUseCase<SettingNodeUpdateNameInput>;

/// <summary>
/// 重命名配置节点输入
Expand All @@ -32,7 +32,6 @@ public SettingNodeUpdateNameUseCase(IBus bus)
_bus = bus;
}

/// <inheritdoc />
public Task ExecuteAsync(SettingNodeUpdateNameInput input, CancellationToken cancellationToken = default)
{
var command = new SettingNodeUpdateCommand(input.Id, "name", input.Name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Nerosoft.Starfish.UseCases;
/// <summary>
/// 配置节点更新用例接口
/// </summary>
public interface ISettingNodeUpdateValueUseCase : IUseCase<SettingNodeUpdateValueInput>;
public interface ISettingNodeUpdateValueUseCase : INonOutputUseCase<SettingNodeUpdateValueInput>;

/// <summary>
/// 配置节点更新输入
Expand All @@ -31,8 +31,7 @@ public SettingNodeUpdateValueUseCase(IBus bus)
{
_bus = bus;
}

/// <inheritdoc />

public Task ExecuteAsync(SettingNodeUpdateValueInput valueInput, CancellationToken cancellationToken = default)
{
var command = new SettingNodeUpdateCommand(valueInput.Id, "Value", valueInput.Value);
Expand Down
1 change: 1 addition & 0 deletions Source/Starfish.Webapi/Starfish.Webapi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<Description>A lightweight powerful distributed configuration server for .NET application.</Description>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
Expand Down

0 comments on commit 6152b21

Please sign in to comment.