package entrustPool

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

type PoolAddrRouter struct {
}

// InitPoolAddrRouter 初始化 PoolAddr 路由信息
func (s *PoolAddrRouter) InitPoolAddrRouter(Router *gin.RouterGroup) {
	poolAddrRouter := Router.Group("poolAddr").Use(middleware.OperationRecord())
	poolAddrRouterWithoutRecord := Router.Group("poolAddr")
	var poolAddrApi = v1.ApiGroupApp.EntrustPoolApiGroup.PoolAddrApi
	{
		poolAddrRouter.POST("createPoolAddr", poolAddrApi.CreatePoolAddr)   // 新建PoolAddr
		poolAddrRouter.DELETE("deletePoolAddr", poolAddrApi.DeletePoolAddr) // 删除PoolAddr
		poolAddrRouter.DELETE("deletePoolAddrByIds", poolAddrApi.DeletePoolAddrByIds) // 批量删除PoolAddr
		poolAddrRouter.PUT("updatePoolAddr", poolAddrApi.UpdatePoolAddr)    // 更新PoolAddr
	}
	{
		poolAddrRouterWithoutRecord.GET("findPoolAddr", poolAddrApi.FindPoolAddr)        // 根据ID获取PoolAddr
		poolAddrRouterWithoutRecord.GET("getPoolAddrList", poolAddrApi.GetPoolAddrList)  // 获取PoolAddr列表
	}
}

// InitPoolAddrPubRouter 初始化 PoolAddr 路由信息
func (s *PoolAddrRouter) InitPoolAddrPubRouter(Router *gin.RouterGroup) {
	poolAddrRouterWithoutRecord := Router.Group("poolAddrWeb")
	var poolAddrApi = v1.ApiGroupApp.EntrustPoolApiGroup.PoolAddrApi
	{
		poolAddrRouterWithoutRecord.GET("getAddrInfo", poolAddrApi.GetAddrInfo)        // 根据ID获取PoolAddr
		poolAddrRouterWithoutRecord.POST("updateAddrFee",poolAddrApi.UpdateAddrFee)    // 根据ID更新AddrFee
	}
}