workspace_controller.go 573 B

12345678910111213141516171819202122232425
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "youngee_b_api/app/service"
  5. )
  6. type WorkspaceController struct{}
  7. type GetTakegoodsInfoParam struct {
  8. EnterpriseId string `json:"enterprise_id"`
  9. DateRange string `json:"days"`
  10. }
  11. func (w WorkspaceController) GetTakegoodsInfo(c *gin.Context) {
  12. search := &GetTakegoodsInfoParam{}
  13. err := c.BindJSON(&search)
  14. if err != nil {
  15. returnError(c, 40000, "error")
  16. return
  17. }
  18. result := service.EnterpriseService{}.GetEnterpriseTakegoodsInfo(search.EnterpriseId, search.DateRange)
  19. returnSuccess(c, 20000, result)
  20. }