feat 获取设备

This commit is contained in:
cheche
2024-01-12 15:42:55 +08:00
parent 092beab4b7
commit 310620b348
6 changed files with 27 additions and 0 deletions

View File

@@ -139,4 +139,14 @@ public class DevicesController : ControllerBase
{
return await _deviceService.CheckExistsAsync(deviceUniqueNo);
}
/// <summary>
/// 获取设备
/// </summary>
/// <param name="UniqueNo"></param>
/// <returns></returns>
[HttpGet]
public async Task<DeviceResponse> GetSettingASync(string UniqueNo)
{
return await _deviceService.GetSettingASync(UniqueNo);
}
}

View File

@@ -11,4 +11,6 @@ public interface IDeviceService : IScopeDependency
Task SaveAsync(DeviceSaveRequest request);
Task<bool> CheckExistsAsync(string deviceUniqueNo);
Task<DeviceResponse> GetSettingASync(string UniqueNo);
}

View File

@@ -145,5 +145,17 @@ public class DeviceService : IDeviceService
.Where(x => x.UniqueNo == deviceUniqueNo && x.Enable)
.AnyAsync();
}
/// <summary>
/// 根据唯一号获取设备
/// </summary>
/// <param name="UniqueNo"></param>
/// <returns></returns>
public async Task<DeviceResponse> GetSettingASync(string UniqueNo)
{
var dev =await _dbContext.Queryable<DeviceEntity>().Where(x => x.UniqueNo == UniqueNo).FirstAsync();
var deviceResponse = dev.Adapt<DeviceResponse>();
return deviceResponse;
}
}

View File

@@ -66,4 +66,5 @@ public class SettingController : ControllerBase
{
return await _settingService.GetUserSettingAsync(userNo);
}
}

View File

@@ -19,5 +19,6 @@ public interface ICanteenSettingService : IScopeDependency
/// <param name="userNo">就餐人员档案号</param>
/// <returns></returns>
Task<Dictionary<CanteenSettingItemEnumType, string>> GetUserSettingAsync(string userNo);
}

View File

@@ -194,4 +194,5 @@ public class CanteenSettingService : ICanteenSettingService
return true;
}
}