package route

import (
	v1 "designs/controller/v1"
	"designs/middleware"
	"github.com/gin-gonic/gin"
)

/* 跨域 */

func SetApiGroupRoutes(router *gin.RouterGroup) {
	// v1 版本
	router.POST("/user/login", v1.Login)                                                        //游戏登录
	router.POST("/user/refreshToken", middleware.RefreshTokenAuthMiddleware(), v1.RefreshToken) //token刷新
	router.POST("/user/getSysTime", v1.GetSysTime)

	GroupV1 := router.Group("")
	GroupV1.Use(middleware.TokenAuthMiddleware()).Use()
	{
		GroupV1.POST("/user/userList", v1.UserList)

		GroupV1.POST("/user/addGidConfig", v1.AddGidConfig)
		GroupV1.POST("/user/getGidConfig", v1.GetGidConfig)

		GroupV1.POST("/user/addUserToBlackList", v1.AddUserToBlackList)
		GroupV1.POST("/user/deleteUserFormBlackList", v1.DeleteUserFormBlackList)
		GroupV1.POST("/user/readBlackList", v1.ReadBlackList)

		GroupV1.POST("/user/addUserOption", v1.AddUserOption)
		GroupV1.POST("/user/getUserOption", v1.GetUserOption)
	}

}
