productdefinition.go 563 B

123456789101112131415161718192021222324252627282930
  1. package controller
  2. import (
  3. "fmt"
  4. "github.com/gin-gonic/gin"
  5. "base-gin/service"
  6. "base-gin/utils/base"
  7. )
  8. type Param struct {
  9. WarehouseCode string `form:"warehouseCode" binding:"required"`
  10. Type int `form:"type"` // 1盘填1,2盘填2
  11. }
  12. func TestGet(c *gin.Context) {
  13. var input Param
  14. if err := c.ShouldBind(&input); err != nil {
  15. base.RenderJsonFail(c, err)
  16. return
  17. }
  18. ret, err := service.TestGet(c)
  19. if err != nil {
  20. base.RenderJsonFail(c, err)
  21. return
  22. }
  23. base.RenderJsonSucc(c, gin.H{"detail": ret})
  24. fmt.Printf("hello test")
  25. }