基础服务api
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

93 lines
3.0 KiB

  1. using BPA.SAAS.Manage.Application.Device.Dtos.Device;
  2. using BPA.SAAS.Manage.Application.Device.Interface;
  3. using BPA.SAAS.Manage.Comm.Model;
  4. using BPA.SAAS.Manage.Core.Base;
  5. using Microsoft.AspNetCore.Components.Forms;
  6. using NPOI.Util;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace BPA.SAAS.Manage.Application.Device
  13. {
  14. [ApiDescriptionSettings("Device", Tag = "设备基础信息管理")]
  15. public class DeviceServices: IDynamicApiController, ITransient
  16. {
  17. IDeviceService _deviceService;
  18. public DeviceServices(IDeviceService deviceService)
  19. {
  20. _deviceService=deviceService;
  21. }
  22. /// <summary>
  23. /// 分页查询
  24. /// </summary>
  25. /// <param name="inputDto"></param>
  26. /// <returns></returns>
  27. [HttpPost("/api/device/page")]
  28. public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto)
  29. {
  30. return await _deviceService.GetDeviceInfoPage(inputDto);
  31. }
  32. /// <summary>
  33. /// 查询设备列表
  34. /// </summary>
  35. /// <returns></returns>
  36. [HttpGet("/api/device/list")]
  37. public async Task<List<ListSelectQuery>> GetDeviceList()
  38. {
  39. return await _deviceService.GetDeviceList();
  40. }
  41. /// <summary>
  42. /// 添加
  43. /// </summary>
  44. /// <param name="inputDto"></param>
  45. /// <returns></returns>
  46. [HttpPost("/api/device/add")]
  47. public async Task<bool> AddDevice(DeviceInfoBaseDto inputDto)
  48. {
  49. return await _deviceService.AddDevice(inputDto);
  50. }
  51. /// <summary>
  52. /// 修改
  53. /// </summary>
  54. /// <param name="inputDto"></param>
  55. /// <returns></returns>
  56. [HttpPost("/api/device/update")]
  57. public async Task<bool> UpdateDevice(DeviceInfoBaseDto inputDto)
  58. {
  59. return await _deviceService.UpdateDevice(inputDto);
  60. }
  61. /// <summary>
  62. /// 删除
  63. /// </summary>
  64. /// <param name="inputList"></param>
  65. /// <returns></returns>
  66. [HttpPost("/api/device/delete")]
  67. public async Task<bool> DelDeviceInfo(List<string> inputList)
  68. {
  69. return await _deviceService.DelDeviceInfo(inputList);
  70. }
  71. /// <summary>
  72. /// 添加设备标签
  73. /// </summary>
  74. /// <param name="inputDto"></param>
  75. /// <returns></returns>
  76. [HttpPost("/api/device/adddevicetype")]
  77. public async Task<bool> AddDeviceTypeAsync(DeviceTypeBaseDto inputDto)
  78. {
  79. return await _deviceService.AddDeviceTypeAsync(inputDto);
  80. }
  81. /// <summary>
  82. /// 查询设备标签
  83. /// </summary>
  84. /// <returns></returns>
  85. [HttpGet("/api/device/getdevicetypelist")]
  86. public async Task<List<ListSelectQuery>> GetDeviceTypeList()
  87. {
  88. return await _deviceService.GetDeviceTypeList();
  89. }
  90. }
  91. }