feat 获取设备
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,6 @@ public interface IDeviceService : IScopeDependency
|
||||
Task SaveAsync(DeviceSaveRequest request);
|
||||
|
||||
Task<bool> CheckExistsAsync(string deviceUniqueNo);
|
||||
|
||||
Task<DeviceResponse> GetSettingASync(string UniqueNo);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,4 +66,5 @@ public class SettingController : ControllerBase
|
||||
{
|
||||
return await _settingService.GetUserSettingAsync(userNo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,5 +19,6 @@ public interface ICanteenSettingService : IScopeDependency
|
||||
/// <param name="userNo">就餐人员档案号</param>
|
||||
/// <returns></returns>
|
||||
Task<Dictionary<CanteenSettingItemEnumType, string>> GetUserSettingAsync(string userNo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -194,4 +194,5 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user