基础服务api
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

104 řádky
3.8 KiB

  1. using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute;
  2. using BPA.SAAS.Manage.Application.DataBase.Interface;
  3. using BPA.SAAS.Manage.Core.Base;
  4. using BPA.SAAS.Manage.Core.DataBase;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace BPA.SAAS.Manage.Application.DataBase
  11. {
  12. [ApiDescriptionSettings("Goods", Tag = "商品属性管理")]
  13. public class GoodsAttributeServices: IDynamicApiController, ITransient
  14. {
  15. IGoodsAttributeService _goodsAttributeServices;
  16. public GoodsAttributeServices(IGoodsAttributeService goodsAttributeServices)
  17. {
  18. _goodsAttributeServices = goodsAttributeServices;
  19. }
  20. /// <summary>
  21. /// 分页查询
  22. /// </summary>
  23. /// <param name="dto"></param>
  24. /// <returns></returns>
  25. [HttpPost("/api/goodsattribute/getgoodsattributepage")]
  26. public PageUtil GetGoodsAttributePageAsync(GoodsAttributeQueryDto dto)
  27. {
  28. return _goodsAttributeServices.GetGoodsAttributePageAsync(dto);
  29. }
  30. /// <summary>
  31. /// 查询商品属性(外部调用)
  32. /// </summary>
  33. /// <returns></returns>
  34. [HttpGet("/api/goodsattribute/getgoodsattributelist_alm")]
  35. [AllowAnonymous]
  36. public async Task<List<GoodsAttributeView>> GetGoodsAttributeList_alm()
  37. {
  38. return await _goodsAttributeServices.GetGoodsAttributeList_alm();
  39. }
  40. /// <summary>
  41. /// 添加/修改
  42. /// </summary>
  43. /// <param name="dto"></param>
  44. /// <returns></returns>
  45. [HttpPost("/api/goodsattribute/addgoodsattribute")]
  46. public async Task<bool> AddGoodsAttribute(GoodsAttributeDto dto)
  47. {
  48. return await _goodsAttributeServices.AddGoodsAttribute(dto);
  49. }
  50. /// <summary>
  51. /// 删除
  52. /// </summary>
  53. /// <param name="Ids"></param>
  54. /// <returns></returns>
  55. [HttpPost("/api/goodsattribute/deletegoodsattribute")]
  56. public async Task<bool> DeleteGoodsAttribute([FromBody] string[] Ids)
  57. {
  58. return await _goodsAttributeServices.DeleteGoodsAttribute(Ids);
  59. }
  60. /// <summary>
  61. /// 查询商品属性值列表
  62. /// </summary>
  63. /// <param name="goodsAttributeId"></param>
  64. /// <returns></returns>
  65. [HttpGet("/api/goodsattribute/getgoodsattributevalue")]
  66. public async Task<List<BPA_GoodsAttributeValue>> GetGoodsAttributeValueAsync(string goodsAttributeId)
  67. {
  68. return await _goodsAttributeServices.GetGoodsAttributeValueAsync(goodsAttributeId);
  69. }
  70. /// <summary>
  71. /// 添加/修改
  72. /// </summary>
  73. /// <param name="dto"></param>
  74. /// <returns></returns>
  75. [HttpPost("/api/goodsattribute/addgoodsattributevalue")]
  76. public async Task<bool> AddGoodsAttributeValue(List<GoodsAttributeValueDto> dto)
  77. {
  78. return await _goodsAttributeServices.AddGoodsAttributeValue(dto);
  79. }
  80. /// <summary>
  81. /// 删除
  82. /// </summary>
  83. /// <param name="id"></param>
  84. /// <returns></returns>
  85. [HttpGet("/api/goodsattribute/deletegoodsattributevalue")]
  86. public async Task<bool> DeleteGoodsAttributeValue(string id)
  87. {
  88. return await _goodsAttributeServices.DeleteGoodsAttributeValue(id);
  89. }
  90. /// <summary>
  91. /// 根据商品id查询商品属性
  92. /// </summary>
  93. /// <param name="id"></param>
  94. /// <returns></returns>
  95. [HttpGet("/api/goodsattribute/getbygoodsidattribute")]
  96. public async Task<List<GoodsAttributeList>> GetByGoodsIdAttribute(string id)
  97. {
  98. return await _goodsAttributeServices.GetByGoodsIdAttribute(id);
  99. }
  100. }
  101. }