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

83 lines
2.7 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.Product;
  5. using Microsoft.AspNetCore.Components.Forms;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace BPA.SAAS.Manage.Application.Device
  12. {
  13. [ApiDescriptionSettings("Device", Tag = "产品管理")]
  14. public class ProductServices: IDynamicApiController, ITransient
  15. {
  16. IProductService _productService;
  17. public ProductServices(IProductService productService)
  18. {
  19. _productService=productService;
  20. }
  21. /// <summary>
  22. /// 分页查询
  23. /// </summary>
  24. /// <param name="inputDto"></param>
  25. /// <returns></returns>
  26. [HttpPost("/api/product/page")]
  27. public async Task<PageUtil> GetProductPage(ProductQueryInputDto inputDto)
  28. {
  29. return await _productService.GetProductPage(inputDto);
  30. }
  31. /// <summary>
  32. /// 查询列表
  33. /// </summary>
  34. /// <returns></returns>
  35. [HttpGet("/api/product/list")]
  36. public async Task<List<BPA_Product>> GetProductList()
  37. {
  38. return await _productService.GetProductList();
  39. }
  40. /// <summary>
  41. /// 添加
  42. /// </summary>
  43. /// <param name="inputDto"></param>
  44. /// <returns></returns>
  45. [HttpPost("/api/product/add")]
  46. public async Task<bool> AddProduct(ProductBaseDto inputDto)
  47. {
  48. return await _productService.AddProduct(inputDto);
  49. }
  50. /// <summary>
  51. /// 删除
  52. /// </summary>
  53. /// <param name="inputList"></param>
  54. /// <returns></returns>
  55. [HttpPost("/api/product/delete")]
  56. public async Task<bool> DeProduct(List<string> inputList)
  57. {
  58. return await _productService.DeProduct(inputList);
  59. }
  60. /// <summary>
  61. /// 更新
  62. /// </summary>
  63. /// <param name="inputDto"></param>
  64. /// <returns></returns>
  65. [HttpPost("/api/product/update")]
  66. public async Task<bool> UpdateProduct(ProductBaseDto inputDto)
  67. {
  68. return await _productService.UpdateProduct(inputDto);
  69. }
  70. /// <summary>
  71. /// 更新状态
  72. /// </summary>
  73. /// <param name="inputDto"></param>
  74. /// <returns></returns>
  75. [HttpPost("/api/product/updatestatus")]
  76. public async Task<bool> UpdateDeviceVesionSatatus(ProductSatatusDto inputDto)
  77. {
  78. return await _productService.UpdateDeviceVesionSatatus(inputDto);
  79. }
  80. }
  81. }