基础服务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.
 
 

94 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.Core.Base;
  4. using BPA.SAAS.Manage.Core.Device;
  5. using BPA.SAAS.Manage.Core.Product;
  6. using Microsoft.AspNetCore.Components.Forms;
  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 ProductServices: IDynamicApiController, ITransient
  16. {
  17. IProductService _productService;
  18. public ProductServices(IProductService productService)
  19. {
  20. _productService=productService;
  21. }
  22. /// <summary>
  23. /// 分页查询
  24. /// </summary>
  25. /// <param name="inputDto"></param>
  26. /// <returns></returns>
  27. [HttpPost("/api/product/page")]
  28. public async Task<PageUtil> GetProductPage(ProductQueryInputDto inputDto)
  29. {
  30. return await _productService.GetProductPage(inputDto);
  31. }
  32. /// <summary>
  33. /// 查询列表
  34. /// </summary>
  35. /// <returns></returns>
  36. [HttpGet("/api/product/list")]
  37. public async Task<List<BPA_Product>> GetProductList()
  38. {
  39. return await _productService.GetProductList();
  40. }
  41. /// <summary>
  42. /// 根据产品id查询产品信息
  43. /// </summary>
  44. /// <param name="productId"></param>
  45. /// <returns></returns>
  46. [HttpGet("/api/product/getproduct")]
  47. public async Task<BPA_Product> GetProduct(string productId)
  48. {
  49. return await _productService.GetProduct(productId);
  50. }
  51. /// <summary>
  52. /// 添加
  53. /// </summary>
  54. /// <param name="inputDto"></param>
  55. /// <returns></returns>
  56. [HttpPost("/api/product/add")]
  57. public async Task<bool> AddProduct(ProductBaseDto inputDto)
  58. {
  59. return await _productService.AddProduct(inputDto);
  60. }
  61. /// <summary>
  62. /// 删除
  63. /// </summary>
  64. /// <param name="inputList"></param>
  65. /// <returns></returns>
  66. [HttpPost("/api/product/delete")]
  67. public async Task<bool> DeProduct(List<string> inputList)
  68. {
  69. return await _productService.DeProduct(inputList);
  70. }
  71. /// <summary>
  72. /// 更新
  73. /// </summary>
  74. /// <param name="inputDto"></param>
  75. /// <returns></returns>
  76. [HttpPost("/api/product/update")]
  77. public async Task<bool> UpdateProduct(ProductBaseDto inputDto)
  78. {
  79. return await _productService.UpdateProduct(inputDto);
  80. }
  81. /// <summary>
  82. /// 更新状态
  83. /// </summary>
  84. /// <param name="inputDto"></param>
  85. /// <returns></returns>
  86. [HttpPost("/api/product/updatestatus")]
  87. public async Task<bool> UpdateDeviceVesionSatatus(ProductSatatusDto inputDto)
  88. {
  89. return await _productService.UpdateDeviceVesionSatatus(inputDto);
  90. }
  91. }
  92. }