/*
 * @Descripttion:
 * @version:
 * @Author: Neo,Huang
 * @Date: 2022-02-08 15:14:13
 * @LastEditors: Neo,Huang
 * @LastEditTime: 2023-11-19 00:54:28
 */
package routers

import (
	"log"

	"box-gm/controllers"

	"github.com/astaxie/beego"
	"github.com/astaxie/beego/plugins/cors"
)

// 注册路由
func init() {
	log.Println("初始化路由器")

	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
		AllowAllOrigins:  true,
		AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
		AllowHeaders:     []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
		ExposeHeaders:    []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
		AllowCredentials: true,
	}))

	beego.Router("/", &controllers.MainController{})
	beego.Router("/index", &controllers.MainController{})
	beego.Router("/accountlogin", &controllers.AccountLoginController{})
	beego.Router("/accountlogout", &controllers.AccountLogoutController{})
	beego.Router("/welcome", &controllers.WelcomeController{})
	beego.Router("/role", &controllers.RoleController{})
	beego.Router("/user", &controllers.UserController{})
	beego.Router("/log", &controllers.LogController{})
	beego.Router("/gamelevel", &controllers.GameLevelController{})
	beego.Router("/register", &controllers.RegisterController{})
	beego.Router("/retained", &controllers.RetainedController{})
	beego.Router("/login", &controllers.LoginController{})
	beego.Router("/onlinetime", &controllers.OnlineTimeController{})
	beego.Router("/playerlevel", &controllers.PlayerLevelController{})
	beego.Router("/resource", &controllers.ResourceController{})
	beego.Router("/realtime", &controllers.RealTimeController{})
	beego.Router("/rtregister", &controllers.RtRegisterController{})
	beego.Router("/rtlogin", &controllers.RtLoginController{})
	beego.Router("/rtonline", &controllers.RtOnlineController{})
	beego.Router("/rtpay", &controllers.RtPayController{})
	beego.Router("/rtpaylogin", &controllers.RtPayLoginController{})
	beego.Router("/pay", &controllers.PayController{})
	beego.Router("/paynum", &controllers.PayNumController{})
	beego.Router("/goods", &controllers.GoodsController{})
	beego.Router("/orderquery", &controllers.OrderQueryController{})
	beego.Router("/hotfix", &controllers.HotfixController{})
	beego.Router("/version", &controllers.VersionController{})
	beego.Router("/client", &controllers.ClientController{})
	beego.Router("/banip", &controllers.BanIPController{})
	beego.Router("/exchangecode", &controllers.ExchangeCodeController{})
	beego.Router("/gameconfig", &controllers.GameConfigController{})
	beego.Router("/rollaward", &controllers.RollAwardController{})
	beego.Router("/roll", &controllers.RollController{})
}
