add voice service call service and more

This commit is contained in:
2025-11-25 16:49:18 +03:30
parent 60d20a2734
commit 9ba81d944f
49 changed files with 4428 additions and 19 deletions

View File

@@ -35,4 +35,31 @@ public class DevicesController : ControllerBase
var id = await deviceService.AddDeviceAsync(dto, cancellationToken);
return Ok(id);
}
[HttpGet("user/{userId}")]
public async Task<ActionResult<IReadOnlyList<DeviceDto>>> GetUserDevices(int userId, CancellationToken cancellationToken)
{
var result = await deviceService.GetUserDevicesAsync(userId, cancellationToken);
return Ok(result);
}
[HttpGet("filtered")]
public async Task<ActionResult<PagedResult<DeviceDto>>> GetDevices(
[FromQuery] int userId,
[FromQuery] string? search = null,
[FromQuery] int page = 1,
[FromQuery] int pageSize = 10,
CancellationToken cancellationToken = default)
{
var filter = new DeviceFilter
{
UserId = userId,
Search = search,
Page = page,
PageSize = pageSize
};
var result = await deviceService.GetDevicesAsync(filter, cancellationToken);
return Ok(result);
}
}