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

71 lines
2.2 KiB

  1. using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsType;
  2. using BPA.SAAS.Manage.Application.DataBase.Interface;
  3. using BPA.SAAS.Manage.Core.Base;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace BPA.SAAS.Manage.Application.DataBase
  10. {
  11. [ApiDescriptionSettings("Goods", Tag = "商品类型管理")]
  12. public class GoodsTypeServices: IDynamicApiController, ITransient
  13. {
  14. IGoodsTypeService _goodsTypeService;
  15. public GoodsTypeServices(IGoodsTypeService goodsTypeService)
  16. {
  17. _goodsTypeService = goodsTypeService;
  18. }
  19. /// <summary>
  20. /// 分页查询
  21. /// </summary>
  22. /// <param name="dto"></param>
  23. /// <returns></returns>
  24. [HttpPost("/api/goodstype/page")]
  25. public async Task<PageUtil> GetGoodsTypePage(GoodsTypeQueryDto dto)
  26. {
  27. return await _goodsTypeService.GetGoodsTypePage(dto);
  28. }
  29. /// <summary>
  30. /// 添加商品类型
  31. /// </summary>
  32. /// <param name="dto"></param>
  33. /// <returns></returns>
  34. [HttpPost("/api/goodstype/add")]
  35. public async Task<bool> AddGoodsType(GoodsTypeDto dto)
  36. {
  37. return await _goodsTypeService.AddGoodsType(dto);
  38. }
  39. /// <summary>
  40. /// 更新商品类型
  41. /// </summary>
  42. /// <param name="dto"></param>
  43. /// <returns></returns>
  44. [HttpPost("/api/goodstype/update")]
  45. public async Task<bool> UpdateGoodsType(GoodsTypeDto dto)
  46. {
  47. return await _goodsTypeService.UpdateGoodsType(dto);
  48. }
  49. /// <summary>
  50. /// 删除商品类型
  51. /// </summary>
  52. /// <param name="Id"></param>
  53. /// <returns></returns>
  54. [HttpGet("/api/goodstype/delete")]
  55. public async Task<bool> DelGoodsType(string Id)
  56. {
  57. return await _goodsTypeService.DelGoodsType(Id);
  58. }
  59. /// <summary>
  60. /// 查询商品类型树结构
  61. /// </summary>
  62. /// <returns></returns>
  63. [HttpGet("/api/goodstype/tree")]
  64. public async Task<dynamic> GetGoodsTypeTree()
  65. {
  66. return await _goodsTypeService.GetGoodsTypeTree();
  67. }
  68. }
  69. }