//======================================================================//
//																		//
//		Generated by gin-annotation (github.com/1-st/gin-annotation)	//
//																		//
//				***	you should call Route() manually ***				//
//																		//
//======================================================================//


package main

import (
	"complex-demo/controller"
	"complex-demo/controller/api"
	"complex-demo/controller/api/v1"
	"complex-demo/controller/api/v2"
	"complex-demo/other/middleware"
	"github.com/gin-gonic/gin"
)

func Route(e *gin.Engine) {
	e.GET("/ping", controller.PingPong)
	e.GET("/api/v1", api.ApiV1)
	e.GET("/api/v2", middleware.SaveRequestIP, middleware.SaveRequestTime, api.ApiV2)
	apiV1 := e.Group("/api/v1")
	{
		userName := apiV1.Group("/user/:name")
		{
			userName.GET("/age", v1.Age)
			userName.GET("/avatar", v1.Avatar)
			private := userName.Group("/private", middleware.Auth1, middleware.Auth2)
			{
				private.GET("/id", v1.ID)
			}
		}
	}
	apiV2 := e.Group("/api/v2")
	{
		userName := apiV2.Group("/user/:name")
		{
			userName.GET("/age", v2.Age)
			userName.GET("/avatar", v2.Avatar)
			private := userName.Group("/private", middleware.Auth1, middleware.Auth2)
			{
				private.GET("/id", v2.ID)
			}
		}
	}
	extra := e.Group("/extra")
	{
		extra.Any("/hello-world", controller.HelloWorld)
	}
}
