common_controller.go 781 B

12345678910111213141516171819202122232425262728293031
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/sirupsen/logrus"
  5. "youngee_b_api/app/service"
  6. )
  7. type CommonController struct{}
  8. // 获取合作平台列表
  9. func (t CommonController) CooperationPlatform(c *gin.Context) {
  10. result, err := service.CommonService{}.CooperationPlatform()
  11. if err != nil {
  12. logrus.Errorf("[CooperationPlatform] call Show err:%+v\n", err)
  13. returnError(c, 40000, err.Error())
  14. return
  15. }
  16. returnSuccess(c, 20000, result)
  17. }
  18. // 获取商品类目
  19. func (t CommonController) ProductCategory(c *gin.Context) {
  20. result, err := service.ProductService{}.GetProductCategorys()
  21. if err != nil {
  22. logrus.Errorf("[ProductCategory] call Show err:%+v\n", err)
  23. returnError(c, 40000, err.Error())
  24. return
  25. }
  26. returnSuccess(c, 20000, result)
  27. }