package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"

	"go-admin/app/operate/apis"
	"go-admin/common/middleware"
)

func init() {
	routerCheckRole = append(routerCheckRole, registerOrgMatchRouter)
}

// registerOrgMatchRouter
func registerOrgMatchRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.OrgMatch{}
	r := v1.Group("/org-match").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
	{
		r.GET("", api.GetPage)
		r.GET("/info/:id", api.GetInfo)
		r.GET("/:id", api.Get)
		r.POST("", api.Insert)
		r.PUT("/:id", api.Update)
		r.DELETE("", api.Delete)
		r.GET("/get-player", api.GetPlayer)
		r.GET("/get-player-is-set", api.GetPlayerIsSet)
		r.PUT("/update-player", api.UpdatePlayer)
		r.PUT("/update-player-data", api.UpdatePlayerData)
	}
}
