=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -10,6 +10,7 @@ namespace adas_core.module.ProxyDevices.Services;
|
||||
/// The service handles HTTP requests and returns appropriate responses based on the device's availability and functionality.
|
||||
/// </summary>
|
||||
/// <param name="settings">The settings for the proxy devices, including their configuration and parameters.</param>
|
||||
/// <!-- aidoc:v1 sig=f2b6616 -->
|
||||
public class ProxyDeviceService(IOptions<ProxyDeviceSettings> settings) : IProxyDeviceService
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,6 +24,8 @@ public class ProxyDeviceService(IOptions<ProxyDeviceSettings> settings) : IProxy
|
||||
/// </summary>
|
||||
/// <param name="deviceId">The unique identifier of the proxy device to be processed.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the HttpResponseMessage returned by the device's Process method.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "Summary claims the method 'creates a new instance if it doesn't exist', but the code only returns a NotFound HttpResponseMessage when GetDevice returns null; no instance is ever created." -->
|
||||
public async Task<HttpResponseMessage> Process(string deviceId)
|
||||
{
|
||||
try
|
||||
@@ -45,6 +48,8 @@ public class ProxyDeviceService(IOptions<ProxyDeviceSettings> settings) : IProxy
|
||||
/// </summary>
|
||||
/// <param name="deviceId">The unique identifier of the proxy device to be streamed.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the HttpResponseMessage returned by the device's Stream method.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary states the method 'creates a new instance if [the device] doesn't exist', but the code only calls GetDevice(deviceId) and returns NotFound when the result is null, with no creation logic visible." -->
|
||||
public async Task<HttpResponseMessage> Stream(string deviceId)
|
||||
{
|
||||
try
|
||||
@@ -68,6 +73,10 @@ public class ProxyDeviceService(IOptions<ProxyDeviceSettings> settings) : IProxy
|
||||
/// <param name="deviceId">The unique identifier of the proxy device to be retrieved.</param>
|
||||
/// <returns>The proxy device instance corresponding to the given deviceId.</returns>
|
||||
/// <exception cref="HttpRequestException">Thrown when the device is not found or not enabled.</exception>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=missing_exception
|
||||
/// "HttpRequestException is also thrown with HttpStatusCode.NotImplemented when the device type cannot be resolved via Type.GetType; the documentation only documents the 'not found or not enabled' case." -->
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=wrong_returns
|
||||
/// "The return type is IProxyDevice? and the method can return null (e.g., when Activator.CreateInstance produces an instance that is not IProxyDevice), but the documentation describes it simply as 'The proxy device instance'." -->
|
||||
private IProxyDevice? GetDevice(string deviceId)
|
||||
{
|
||||
var device = settings.Value.FirstOrDefault(d => d.Id == deviceId);
|
||||
|
||||
Reference in New Issue
Block a user