goods.go 780 B

123456789101112131415161718192021222324252627282930313233
  1. package goods
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/global/e"
  5. "mtp2_if/logger"
  6. "mtp2_if/models"
  7. "net/http"
  8. "github.com/gin-gonic/gin"
  9. )
  10. // GetTCEGoodsCollections 获取TCE商品集合表
  11. // @Summary 获取TCE商品集合表
  12. // @Produce json
  13. // @Success 200 {array} models.TCEGoodsCollect
  14. // @Failure 500 {object} app.Response
  15. // @Router /Goods/GetTCEGoodsCollections [get]
  16. // @Tags 商品服务
  17. func GetTCEGoodsCollections(c *gin.Context) {
  18. appG := app.Gin{C: c}
  19. rst, err := models.GetTCEGoodsCollections()
  20. if err != nil {
  21. // 查询失败
  22. logger.GetLogger().Errorf("GetTCEGoodsCollections failed: %s", err.Error())
  23. appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  24. return
  25. }
  26. // 查询成功
  27. appG.Response(http.StatusOK, e.SUCCESS, rst)
  28. }