package routers import ( "github.com/gin-gonic/gin" "hongze/hongze_yb/controller/chart" "hongze/hongze_yb/controller/my_chart" "hongze/hongze_yb/middleware" ) func InitMyChart(r *gin.Engine) { rg := r.Group("api/") // 图表分类 mcc := new(my_chart.MyChartClassifyController) mccGroup := rg.Group("my_chart_classify/").Use(middleware.Token()) mccGroup.GET("list", mcc.List) mccGroup.POST("add", mcc.Add) mccGroup.POST("edit", mcc.Edit) mccGroup.POST("sort", mcc.Sort) mccGroup.POST("del", mcc.Del) // 我的图表 mc := new(my_chart.MyChartController) mcGroup := rg.Group("my_chart/").Use(middleware.Token()) mcGroup.GET("list", mc.List) mcGroup.POST("relate_classify", mc.RelateClassify) mcGroup.GET("locate", mc.Locate) //mcGroupAuth := rg.Group("my_chart/").Use(middleware.Token(), middleware.CheckBaseAuth()) mcGroup.GET("detail", chart.GetChartInfoDetail) mcGroup.GET("common/detail", chart.CommonChartInfoDetailFromUniqueCode) // 以下接口可能是从iframe发出请求, 所以token被放在入参中处理而不是header里 mcGroupNo := rg.Group("my_chart/") mcGroupNo.POST("collect", mc.Collect) mcGroupNo.POST("collect_cancel", mc.CollectCancel) mcGroupNo.GET("is_collect", mc.IsCollect) }