Skip to content

Commit d931ec0

Browse files
committed
Rename ResponseDevice to DeviceResponse
1 parent 8672ab7 commit d931ec0

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

API/Controller/Devices/DevicesController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public sealed partial class DevicesController
2525
/// <response code="200">All devices for the current user</response>
2626
[HttpGet]
2727
[MapToApiVersion("1")]
28-
[ProducesResponseType<LegacyDataResponse<Models.Response.ResponseDevice[]>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
28+
[ProducesResponseType<LegacyDataResponse<Models.Response.DeviceResponse[]>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
2929
public IActionResult ListDevices()
3030
{
3131
var devices = _db.Devices
3232
.Where(x => x.OwnerId == CurrentUser.Id)
33-
.Select(x => new Models.Response.ResponseDevice
33+
.Select(x => new Models.Response.DeviceResponse
3434
{
3535
Id = x.Id,
3636
Name = x.Name,
@@ -47,7 +47,7 @@ public IActionResult ListDevices()
4747
/// <param name="deviceId"></param>
4848
/// <response code="200">The device</response>
4949
[HttpGet("{deviceId}")]
50-
[ProducesResponseType<LegacyDataResponse<Models.Response.ResponseDeviceWithToken>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
50+
[ProducesResponseType<LegacyDataResponse<Models.Response.DeviceWithTokenResponse>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
5151
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status404NotFound, MediaTypeNames.Application.ProblemJson)] // DeviceNotFound
5252
[MapToApiVersion("1")]
5353
public async Task<IActionResult> GetDeviceById([FromRoute] Guid deviceId)
@@ -56,7 +56,7 @@ public async Task<IActionResult> GetDeviceById([FromRoute] Guid deviceId)
5656

5757

5858
var device = await _db.Devices.Where(x => x.OwnerId == CurrentUser.Id && x.Id == deviceId)
59-
.Select(x => new Models.Response.ResponseDeviceWithToken
59+
.Select(x => new Models.Response.DeviceWithTokenResponse
6060
{
6161
Id = x.Id,
6262
Name = x.Name,

API/Controller/Shockers/ListShockers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public sealed partial class ShockerController
1515
/// <response code="200">The shockers were successfully retrieved.</response>
1616
[HttpGet("own")]
1717
[MapToApiVersion("1")]
18-
[ProducesResponseType<LegacyDataResponse<ResponseDeviceWithShockers[]>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
18+
[ProducesResponseType<LegacyDataResponse<DeviceWithShockersResponse[]>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
1919
public IActionResult ListShockers()
2020
{
2121
var shockers = _db.Devices
2222
.Where(x => x.OwnerId == CurrentUser.Id)
23-
.OrderBy(x => x.CreatedAt).Select(x => new ResponseDeviceWithShockers
23+
.OrderBy(x => x.CreatedAt).Select(x => new DeviceWithShockersResponse
2424
{
2525
Id = x.Id,
2626
Name = x.Name,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace OpenShock.API.Models.Response;
22

3-
public class ResponseDevice
3+
public class DeviceResponse
44
{
55
public required Guid Id { get; init; }
66
public required string Name { get; init; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace OpenShock.API.Models.Response;
22

3-
public sealed class ResponseDeviceWithShockers : ResponseDevice
3+
public sealed class DeviceWithShockersResponse : DeviceResponse
44
{
55
public required ShockerResponse[] Shockers { get; init; }
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace OpenShock.API.Models.Response;
22

3-
public sealed class ResponseDeviceWithToken : ResponseDevice
3+
public sealed class DeviceWithTokenResponse : DeviceResponse
44
{
55
public required string? Token { get; init; }
66
}

0 commit comments

Comments
 (0)