package entrustPool

import (
	"github.com/gin-gonic/gin"
	"courseSign/server/api/v1"
	"courseSign/server/middleware"
)

type PoolRouter struct {
}

// InitPoolRouter 初始化 Pool 路由信息
func (s *PoolRouter) InitPoolRouter(Router *gin.RouterGroup) {
	poolRouter := Router.Group("pool").Use(middleware.OperationRecord())
	poolRouterWithoutRecord := Router.Group("pool")
	var poolApi = v1.ApiGroupApp.EntrustPoolApiGroup.PoolApi
	{
		poolRouter.POST("createPool", poolApi.CreatePool)   // 新建Pool
		poolRouter.DELETE("deletePool", poolApi.DeletePool) // 删除Pool
		poolRouter.DELETE("deletePoolByIds", poolApi.DeletePoolByIds) // 批量删除Pool
		poolRouter.PUT("updatePool", poolApi.UpdatePool)    // 更新Pool
	}
	{
		poolRouterWithoutRecord.GET("findPool", poolApi.FindPool)        // 根据ID获取Pool
		poolRouterWithoutRecord.GET("getPoolList", poolApi.GetPoolList2)  // 获取Pool列表
	}
}

// InitPoolPubRouter 初始化 Pool 路由信息
func (s *PoolRouter) InitPoolPubRouter(Router *gin.RouterGroup) {
	poolRouterWithoutRecord := Router.Group("poolWeb")
	var poolApi = v1.ApiGroupApp.EntrustPoolApiGroup.PoolApi
	{
		poolRouterWithoutRecord.GET("findPool", poolApi.FindPool)        // 根据ID获取Pool
		poolRouterWithoutRecord.GET("getPoolList", poolApi.GetPoolList)  // 获取Pool列表
		poolRouterWithoutRecord.POST("addPool", poolApi.AddPool)  // 添加节点
		poolRouterWithoutRecord.POST("updatePool", poolApi.UpdateWebPool)  // 添加节点
	}
}