package router

import (
	"fonchain-fiee/pkg/middleware"
	"fonchain-fiee/pkg/service"
	"fonchain-fiee/pkg/service/bundle"

	"github.com/gin-gonic/gin"
)

func ValueAddBundleRouter(r *gin.RouterGroup) {
	valueAddBundleRoute := r.Group("valueAdd-bundle")
	valueAddBundleRoute.Use(middleware.CheckWebLogin(service.AccountProvider))

	valueAddBundleAppRoute := r.Group("valueAdd-bundle/app")
	valueAddBundleAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))

	// 增值套餐
	{
		bundleClientRoute := valueAddBundleRoute.Group("system")
		{
			bundleClientRoute.POST("create", bundle.CreateValueAddBundle)
			bundleClientRoute.POST("list", bundle.ValueAddBundleList)
			bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail)
		}
		bundleClientRouteV2 := valueAddBundleRoute.Group("system/v2")
		{
			bundleClientRouteV2.POST("save", bundle.SaveValueAddService)
			bundleClientRouteV2.POST("list", bundle.ValueAddServiceList)
			bundleClientRouteV2.POST("detail", bundle.ValueAddServiceDetail)
		}

		valueAddBundleAppRouteV1 := valueAddBundleAppRoute.Group("system")
		{
			valueAddBundleAppRouteV1.POST("list", bundle.ValueAddBundleList)
		}
		valueAddBundleAppRouteV2 := valueAddBundleAppRoute.Group("system/v2")
		{
			valueAddBundleAppRouteV2.POST("list", bundle.ValueAddServiceList)
			valueAddBundleAppRouteV2.POST("detail", bundle.ValueAddServiceDetail)
			valueAddBundleAppRouteV2.POST("detail/lang", bundle.ValueAddServiceLangDetail)
		}

	}

}
