package oam

import (
	"github.com/gin-gonic/gin"

	"be.ems/src/framework/middleware"
	monitorController "be.ems/src/modules/monitor/controller"
	neController "be.ems/src/modules/ne/controller"
)

// SetupOauth2 客户端授权开放接口
func SetupOauth2(router *gin.Engine) {
	openApiGroup := router.Group("/open-api")

	// 监控
	monitorGroup := openApiGroup.Group("/monitor")
	{
		monitorGroup.GET("/system",
			middleware.AuthorizeOauth2(nil),
			monitorController.NewSystem.Info,
		)
	}

	// 网元
	neGroup := openApiGroup.Group("/ne")
	{
		neGroup.GET("/state",
			middleware.AuthorizeOauth2(nil),
			neController.NewNeInfo.State,
		)
	}

}
