feat: 客户端oauth2认证模块

This commit is contained in:
TsMask
2025-08-12 10:35:18 +08:00
parent 9e57c145d1
commit 72e04a140d
15 changed files with 252 additions and 102 deletions

View File

@@ -0,0 +1,33 @@
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/network_element/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,
)
}
}