package routers

import (
	"github.com/gin-gonic/gin"
	"hongze/hongze_yb/controller/chart"
	"hongze/hongze_yb/middleware"
)

func InitChart(r *gin.Engine) {
	rGroup := r.Group("my_chart").Use(middleware.Token(), middleware.CheckChartAuth())
	{
		rGroup.GET("/getChartChassify", chart.GetMyChartChassify)
		rGroup.GET("/getChartList", chart.GetMyChartList)
		rGroup.POST("/moveMyChart", chart.MoveMyChart)
		rGroup.POST("/moveMyChartClassify", chart.MoveMyChartClassify)
		rGroup.GET("/getChartDetail", chart.GetChartInfoDetail)
		rGroup.POST("/editChartInfo", chart.EditChartInfo)
		rGroup.POST("/refreshChartInfo", chart.RefreshChartInfo)
		rGroup.GET("/getChartBeforeAndNext", chart.GetChartBeforeAndNext)
		rGroup.POST("/future_good/refreshChartInfo", chart.RefreshFutureGoodChartInfo)
		rGroup.POST("/correlation/refreshChartInfo", chart.RefreshCorrelationChartInfo)
	}

	initChart(r)
}

// initChart
func initChart(r *gin.Engine) {
	rGroup := r.Group("api/my_chart").Use(middleware.Token(), middleware.CheckChartAuth())
	{
		rGroup.GET("/getChartChassify", chart.GetMyChartChassify)
		rGroup.GET("/getChartList", chart.GetMyChartList)
		rGroup.POST("/moveMyChart", chart.MoveMyChart)
		rGroup.POST("/moveMyChartClassify", chart.MoveMyChartClassify)
		rGroup.GET("/getChartDetail", chart.GetChartInfoDetail)
		rGroup.POST("/editChartInfo", chart.EditChartInfo)
		rGroup.POST("/refreshChartInfo", chart.RefreshChartInfo)
		rGroup.GET("/getChartBeforeAndNext", chart.GetChartBeforeAndNext)
		rGroup.POST("/future_good/refreshChartInfo", chart.RefreshFutureGoodChartInfo)
		rGroup.POST("/future_good/editChartInfo", chart.FutureGoodChartInfoSave)
		rGroup.POST("/correlation/refreshChartInfo", chart.RefreshCorrelationChartInfo)
	}
}
