my_chart.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package routers
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/hongze_yb/controller/chart"
  5. "hongze/hongze_yb/controller/my_chart"
  6. "hongze/hongze_yb/middleware"
  7. )
  8. func InitMyChart(r *gin.Engine) {
  9. rg := r.Group("api/")
  10. // 图表分类
  11. mcc := new(my_chart.MyChartClassifyController)
  12. mccGroup := rg.Group("my_chart_classify/").Use(middleware.Token())
  13. mccGroup.GET("list", mcc.List)
  14. mccGroup.POST("add", mcc.Add)
  15. mccGroup.POST("edit", mcc.Edit)
  16. mccGroup.POST("sort", mcc.Sort)
  17. mccGroup.POST("del", mcc.Del)
  18. // 我的图表
  19. mc := new(my_chart.MyChartController)
  20. mcGroup := rg.Group("my_chart/").Use(middleware.Token())
  21. mcGroup.GET("list", mc.List)
  22. mcGroup.POST("relate_classify", mc.RelateClassify)
  23. mcGroup.GET("locate", mc.Locate)
  24. //mcGroupAuth := rg.Group("my_chart/").Use(middleware.Token(), middleware.CheckBaseAuth())
  25. mcGroup.GET("detail", chart.GetChartInfoDetail)
  26. mcGroup.GET("common/detail", chart.CommonChartInfoDetailFromUniqueCode)
  27. // 以下接口可能是从iframe发出请求, 所以token被放在入参中处理而不是header里
  28. mcGroupNo := rg.Group("my_chart/")
  29. mcGroupNo.POST("collect", mc.Collect)
  30. mcGroupNo.POST("collect_cancel", mc.CollectCancel)
  31. mcGroupNo.GET("is_collect", mc.IsCollect)
  32. }