stock.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package controllers
  2. import (
  3. _ "Medical_ERP/common/response"
  4. )
  5. type StockController struct {
  6. BaseController
  7. }
  8. // StockIn 入库
  9. // @Summary 入库
  10. // @Description 入库
  11. // @Tags 库存
  12. // @Param body body dto.StockInInsertReq true "body"
  13. // @Success 200 {object} response.Page{list=[]models.StockIn} "{"code": 200, "data": [...]}"
  14. // @Router /stock/in [post]
  15. // @Security Bearer
  16. //func (c StockController) StockIn() {
  17. // s := services.Stock{}
  18. // reqData := dto.StockInInsertReq{}
  19. // if err := c.ParseAndValidate(&c.Ctx.Input.RequestBody, &reqData); err != nil {
  20. // c.Error(global.ParseFormErr, err, err.Error())
  21. // return
  22. // }
  23. //
  24. // reqData.SetCreateBy(beegouser.GetUserId(c.Ctx))
  25. // reqData.SetDeptId(beegouser.GetDeptId(c.Ctx))
  26. // err := s.StockIn(&reqData)
  27. // if err != nil {
  28. // c.Error(500, err, err.Error())
  29. // return
  30. // }
  31. // c.OK(reqData.GetId(), "入库成功")
  32. //}
  33. // StockInList 入库列表
  34. // @Summary 入库列表
  35. // @Description 入库列表
  36. // @Tags 库存
  37. // @Param body body dto.StockPageReq true "body"
  38. // @Success 200 {object} response.Page{list=[]models.StockIn} "{"code": 200, "data": [...]}"
  39. // @Router /stock/in [post]
  40. // @Security Bearer
  41. //func (c StockController) StockInList() {
  42. // s := services.Stock{}
  43. // reqData := dto.StockPageReq{}
  44. // if err := c.ParseAndValidate(&c.Ctx.Input.RequestBody, &reqData); err != nil {
  45. // c.Error(global.ParseFormErr, err, err.Error())
  46. // return
  47. // }
  48. //
  49. // reqData.SetCreateBy(beegouser.GetUserId(c.Ctx))
  50. // reqData.SetDeptId(beegouser.GetDeptId(c.Ctx))
  51. // err := s.StockIn(&reqData)
  52. // if err != nil {
  53. // c.Error(500, err, err.Error())
  54. // return
  55. // }
  56. // c.OK(reqData.GetId(), "入库成功")
  57. //}