Skip to content

Commit

Permalink
Fix fr
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Feb 6, 2025
1 parent 4e5aaf9 commit faace9e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion API/API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>OpenShock.API</AssemblyName>
<RootNamespace>OpenShock.API</RootNamespace>
<AssemblyVersion>3.10.1</AssemblyVersion>
<AssemblyVersion>3.10.2</AssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Company>OpenShock</Company>
<Product>API</Product>
Expand Down
25 changes: 15 additions & 10 deletions API/Controller/Users/GetSelf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,29 @@ public sealed partial class UsersController
/// <response code="200">The user's information was successfully retrieved.</response>
[HttpGet("self")]
[ProducesResponseType<BaseResponse<SelfResponse>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
public BaseResponse<SelfResponse> GetSelf() => new()
public BaseResponse<SelfResponse> GetSelf()
{
Data = new SelfResponse
return new BaseResponse<SelfResponse>
{
Id = CurrentUser.Id,
Name = CurrentUser.Name,
Email = CurrentUser.Email,
Image = CurrentUser.GetImageUrl(),
Roles = CurrentUser.Roles
}
};
Data = new SelfResponse
{
Id = CurrentUser.Id,
Name = CurrentUser.Name,
Email = CurrentUser.Email,
Image = CurrentUser.GetImageUrl(),
Roles = CurrentUser.Roles,
Rank = CurrentUser.Roles.Count > 0 ? CurrentUser.Roles.Max().ToString() : "User"
}
};
}

public sealed class SelfResponse
{
public required Guid Id { get; set; }
public required string Name { get; set; }
public required string Email { get; set; }
public required Uri Image { get; set; }
public required List<RoleType> Roles { get; set; }
public string Rank => Roles.Max().ToString();
public required string Rank { get; set; }
}
}
2 changes: 1 addition & 1 deletion Cron/Cron.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>OpenShock.Cron</AssemblyName>
<RootNamespace>OpenShock.Cron</RootNamespace>
<Company>OpenShock</Company>
<AssemblyVersion>3.10.1</AssemblyVersion>
<AssemblyVersion>3.10.2</AssemblyVersion>
<UserSecretsId>a2109c1e-fb11-44d7-8127-346ef60cb9a5</UserSecretsId>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion LiveControlGateway/LiveControlGateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>OpenShock.LiveControlGateway</AssemblyName>
<RootNamespace>OpenShock.LiveControlGateway</RootNamespace>
<Company>OpenShock</Company>
<AssemblyVersion>3.10.1</AssemblyVersion>
<AssemblyVersion>3.10.2</AssemblyVersion>
<Product>LiveControlGateway</Product>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<UserSecretsId>a2109c1e-fb11-44d7-8127-346ef60cb9a5</UserSecretsId>
Expand Down

0 comments on commit faace9e

Please sign in to comment.