Skip to content

Commit

Permalink
Add image to shared response
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Sep 25, 2024
1 parent 33de84a commit 09a4465
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 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.3.0</AssemblyVersion>
<AssemblyVersion>3.3.1</AssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Company>OpenShock</Company>
<Product>API</Product>
Expand Down
5 changes: 4 additions & 1 deletion API/Controller/Shockers/SharedShockersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using OpenShock.API.Models.Response;
using OpenShock.Common.Models;
using OpenShock.ServicesCommon.Problems;
using OpenShock.ServicesCommon.Utils;

namespace OpenShock.API.Controller.Shockers;

Expand All @@ -23,6 +24,7 @@ public async Task<BaseResponse<IEnumerable<OwnerShockerResponse>>> ListSharedSho
{
OwnerId = x.Shocker.DeviceNavigation.OwnerNavigation.Id,
OwnerName = x.Shocker.DeviceNavigation.OwnerNavigation.Name,
OwnerEmail = x.Shocker.DeviceNavigation.OwnerNavigation.Email,
DeviceId = x.Shocker.DeviceNavigation.Id,
DeviceName = x.Shocker.DeviceNavigation.Name,
Shocker = new OwnerShockerResponse.SharedDevice.SharedShocker
Expand Down Expand Up @@ -54,7 +56,8 @@ public async Task<BaseResponse<IEnumerable<OwnerShockerResponse>>> ListSharedSho
shared[shocker.OwnerId] = new OwnerShockerResponse
{
Id = shocker.OwnerId,
Name = shocker.OwnerName
Name = shocker.OwnerName,
Image = GravatarUtils.GetImageUrl(shocker.OwnerEmail)
};

var sharedUser = shared[shocker.OwnerId];
Expand Down
8 changes: 4 additions & 4 deletions API/Models/Response/OwnerShockerResponse.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace OpenShock.API.Models.Response;
using OpenShock.Common.Models;

public class OwnerShockerResponse
namespace OpenShock.API.Models.Response;

public class OwnerShockerResponse : GenericIni
{
public required Guid Id { get; set; }
public required string Name { get; set; }
public IList<SharedDevice> Devices { get; set; } = new List<SharedDevice>();

public class SharedDevice
Expand Down
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.3.0</AssemblyVersion>
<AssemblyVersion>3.3.1</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.3.0</AssemblyVersion>
<AssemblyVersion>3.3.1</AssemblyVersion>
<Product>LiveControlGateway</Product>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>12</LangVersion>
Expand Down

0 comments on commit 09a4465

Please sign in to comment.