feat: swagger接口文档更新1.0.8
This commit is contained in:
@@ -37,25 +37,103 @@ import (
|
||||
var wg sync.WaitGroup
|
||||
|
||||
// @title OMC Swagger API
|
||||
// @version 1.0.5
|
||||
// @description OMC Service Interface Info
|
||||
// @version 1.0.8
|
||||
// @description OMC Service Interface Information - Internal Use Only
|
||||
//
|
||||
// @tag.name chart
|
||||
// @tag.description chart interface
|
||||
//
|
||||
// @tag.name common
|
||||
// @tag.description common interface
|
||||
// @tag.name common/authorization
|
||||
// @tag.description common authorization Interface
|
||||
// @tag.name common/file
|
||||
// @tag.description common file Interface
|
||||
//
|
||||
// @tag.name monitor
|
||||
// @tag.description monitor interface
|
||||
// @tag.name monitor/cache
|
||||
// @tag.description monitor cache interface
|
||||
// @tag.name monitor/online
|
||||
// @tag.description monitor system user online interface
|
||||
//
|
||||
// @tag.name network_data
|
||||
// @tag.description network data interface
|
||||
// @tag.name network_data/kpi
|
||||
// @tag.description network data kpi interface
|
||||
// @tag.name network_data/amf
|
||||
// @tag.description network data amf interface
|
||||
// @tag.name network_data/ims
|
||||
// @tag.description network data ims interface
|
||||
// @tag.name network_data/mme
|
||||
// @tag.description network data mme interface
|
||||
// @tag.name network_data/sgwc
|
||||
// @tag.description network data sgwc interface
|
||||
// @tag.name network_data/smf
|
||||
// @tag.description network data smf interface
|
||||
// @tag.name network_data/smsc
|
||||
// @tag.description network data smsc interface
|
||||
// @tag.name network_data/udm/auth
|
||||
// @tag.description network data udm authentication interface
|
||||
// @tag.name network_data/udm/sub
|
||||
// @tag.description network data udm subscriber interface
|
||||
// @tag.name network_data/upf
|
||||
// @tag.description network data upf interface
|
||||
//
|
||||
// @tag.name network_element
|
||||
// @tag.description network element interface
|
||||
// @tag.name network_element/action
|
||||
// @tag.description network element operating interface
|
||||
// @tag.name network_element/info
|
||||
// @tag.description network element information interface
|
||||
// @tag.name network_element/host
|
||||
// @tag.description network element host interface
|
||||
// @tag.name network_element/license
|
||||
// @tag.description network element license interface
|
||||
// @tag.name network_element/software
|
||||
// @tag.description network element software interface
|
||||
// @tag.name network_element/version
|
||||
// @tag.description network element version interface
|
||||
// @tag.name network_element/config
|
||||
// @tag.description network element config interface
|
||||
//
|
||||
// @tag.name system
|
||||
// @tag.description system interface
|
||||
// @tag.name system/config
|
||||
// @tag.description system config interface
|
||||
// @tag.name system/dept
|
||||
// @tag.description system dept interface
|
||||
// @tag.name system/dict/data
|
||||
// @tag.description system dict data interface
|
||||
// @tag.name system/dict/type
|
||||
// @tag.description system dict type interface
|
||||
// @tag.name system/log/login
|
||||
// @tag.description system log login interface
|
||||
// @tag.name system/log/operate
|
||||
// @tag.description system log operate interface
|
||||
// @tag.name system/menu
|
||||
// @tag.description system menu interface
|
||||
// @tag.name system/post
|
||||
// @tag.description system post interface
|
||||
// @tag.name system/role
|
||||
// @tag.description system role interface
|
||||
// @tag.name system/user
|
||||
// @tag.description system user interface
|
||||
// @tag.name system/user/profile
|
||||
// @tag.description system user profile interface
|
||||
//
|
||||
// @tag.name tool
|
||||
// @tag.description tool interface
|
||||
// @tag.name tool/ping
|
||||
// @tag.description tool ping interface
|
||||
// @tag.name tool/iperf
|
||||
// @tag.description tool iperf interface
|
||||
//
|
||||
// @tag.name trace
|
||||
// @tag.description trace interface
|
||||
// @tag.name trace/tcpdump
|
||||
// @tag.description trace tcpdump interface
|
||||
//
|
||||
// @tag.name ws
|
||||
// @tag.description ws interface
|
||||
//
|
||||
@@ -66,18 +144,15 @@ var wg sync.WaitGroup
|
||||
// @securityDefinitions.apikey ApiKeyAuth
|
||||
// @in header
|
||||
// @name Authorization
|
||||
// @description Get the key through the login interface, fill in e.g. Bearer <access_token>
|
||||
// @description Get the key through the common/authorization System Login, fill in content "Bearer <access_token>"
|
||||
func main() {
|
||||
// 初始配置加载
|
||||
src.ConfigurationInit()
|
||||
// 程序注册
|
||||
|
||||
app := src.AppEngine()
|
||||
// Swagger 接口文档
|
||||
app.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||
|
||||
loadFeatures(app)
|
||||
|
||||
loadPprof(app)
|
||||
loadDev(app)
|
||||
|
||||
loadServer(app)
|
||||
|
||||
@@ -150,8 +225,14 @@ func loadFeatures(app *gin.Engine) {
|
||||
features.InitServiceEngine(app)
|
||||
}
|
||||
|
||||
// loadPprof 性能分析监控
|
||||
func loadPprof(app *gin.Engine) {
|
||||
// loadDev 开发环境调试
|
||||
func loadDev(app *gin.Engine) {
|
||||
// Swagger 接口文档
|
||||
if config.Env() == "local" {
|
||||
app.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||
}
|
||||
|
||||
//性能分析监控 Prometheus
|
||||
pprofEnabled := config.Get("pprof.enabled")
|
||||
if pprofEnabled != nil && pprofEnabled.(bool) {
|
||||
app.Use(ginprom.PromMiddleware(nil))
|
||||
|
||||
Reference in New Issue
Block a user