From bbef0afeb01317f351a7fad7e908a465df58629b Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 6 Feb 2025 14:29:03 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0swagger=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/monitor/controller/monitor.go | 8 ++- .../network_data/controller/all_kpi.go | 10 +-- .../network_data/controller/udm_auth.go | 4 +- .../network_data/controller/udm_sub.go | 6 +- swagger2docs/docs.go | 69 +++++++++++++++++-- swagger2docs/swagger.json | 69 +++++++++++++++++-- swagger2docs/swagger.yaml | 61 +++++++++++++--- 7 files changed, 195 insertions(+), 32 deletions(-) diff --git a/src/modules/monitor/controller/monitor.go b/src/modules/monitor/controller/monitor.go index b1e90d34..bc18a66a 100644 --- a/src/modules/monitor/controller/monitor.go +++ b/src/modules/monitor/controller/monitor.go @@ -28,7 +28,13 @@ type MonitorController struct { // @Tags monitor // @Accept json // @Produce json -// @Success 200 {object} object "Response Results" +// @Param type query string true "Data Type" Enums(all,load,cpu,memory,io,network) default(all) +// @Param startTime query number true "StartTime, timestamp milliseconds" default(1738771200000) +// @Param endTime query number true "EndTime, timestamp milliseconds" default(1738810051253) +// @Param neType query string false "NE Type, Currently none Default #" default(#) +// @Param neId query string false "NE ID, Currently none Default #" default(#) +// @Param name query string false "Name, Data Type valid for networ and io" +// @Success 200 {object} object "Response Results" // @Security TokenAuth // @Summary Resource monitoring information loading // @Description Resource monitoring information loading diff --git a/src/modules/network_data/controller/all_kpi.go b/src/modules/network_data/controller/all_kpi.go index 6877b3a3..b1a12ccf 100644 --- a/src/modules/network_data/controller/all_kpi.go +++ b/src/modules/network_data/controller/all_kpi.go @@ -31,11 +31,11 @@ type PerfKPIController struct { // @Tags network_data/kpi // @Accept json // @Produce json -// @Param neType query string true "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC) +// @Param neType query string true "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC) default(AMF) // @Param neId query string true "NE ID" default(001) -// @Param startTime query number true "Start time (timestamped milliseconds)" default(1737453599059) -// @Param endTime query number true "End time (timestamped milliseconds)" default(1737453599059) -// @Param interval query number true "interval" Enums(5,10,15,30,60,300,600,900,1800,3600) +// @Param startTime query number true "Start time (timestamped milliseconds)" default(1729162507596) +// @Param endTime query number true "End time (timestamped milliseconds)" default(1729164187611) +// @Param interval query number true "interval" Enums(5,10,15,30,60,300,600,900,1800,3600) default(60) // @Success 200 {object} object "Response Results" // @Security TokenAuth // @Summary Access to statistical data @@ -73,7 +73,7 @@ func (s *PerfKPIController) GoldKPI(c *gin.Context) { // @Tags network_data/kpi // @Accept json // @Produce json -// @Param neType query string true "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC) +// @Param neType query string true "NE Type" Enums(IMS,AMF,AUSF,UDM,SMF,PCF,NSSF,NRF,UPF,MME,CBC,OMC,SGWC) default(AMF) // @Success 200 {object} object "Response Results" // @Security TokenAuth // @Summary Get Statistical Headings diff --git a/src/modules/network_data/controller/udm_auth.go b/src/modules/network_data/controller/udm_auth.go index d2c784ea..cd8c2505 100644 --- a/src/modules/network_data/controller/udm_auth.go +++ b/src/modules/network_data/controller/udm_auth.go @@ -205,7 +205,7 @@ func (s *UDMAuthController) Add(c *gin.Context) { // @Accept json // @Produce json // @Param neId path string true "NE ID" default(001) -// @Param value path number true "Number includes starting imsi" +// @Param value path number true "Number of releases, value includes start imsi" // @Param data body object true "Request Param" // @Success 200 {object} object "Response Results" // @Security TokenAuth @@ -390,7 +390,7 @@ func (s *UDMAuthController) Remove(c *gin.Context) { // @Produce json // @Param neId path string true "NE ID" default(001) // @Param imsi path string true "IMSI" -// @Param num path number true "Number includes starting imsi" +// @Param num path number true "Number of releases, value includes start imsi" // @Success 200 {object} object "Response Results" // @Security TokenAuth // @Summary UDM Authentication User Batch Deletion diff --git a/src/modules/network_data/controller/udm_sub.go b/src/modules/network_data/controller/udm_sub.go index 459c14e2..d8b5d6e2 100644 --- a/src/modules/network_data/controller/udm_sub.go +++ b/src/modules/network_data/controller/udm_sub.go @@ -205,8 +205,8 @@ func (s *UDMSubController) Add(c *gin.Context) { // @Tags network_data/udm/sub // @Accept json // @Produce json -// @Param neId path string true "NE ID" default(001) -// @Param value path number true "Number includes starting imsi" default(1) +// @Param neId path string true "NE ID" default(001) +// @Param value path number true "Number of releases, value includes start imsi" default(1) // @Param data body object true "Request Param" // @Success 200 {object} object "Response Results" // @Security TokenAuth @@ -395,7 +395,7 @@ func (s *UDMSubController) Remove(c *gin.Context) { // @Produce json // @Param neId path string true "NE ID" default(001) // @Param imsi path string true "IMSI" -// @Param num path number true "Number includes starting imsi" +// @Param num path number true "Number of releases, value includes start imsi" // @Success 200 {object} object "Response Results" // @Security TokenAuth // @Summary UDM Subscriber User Batch Deletion diff --git a/swagger2docs/docs.go b/swagger2docs/docs.go index 9e94c773..e62d967f 100644 --- a/swagger2docs/docs.go +++ b/swagger2docs/docs.go @@ -560,6 +560,60 @@ const docTemplate = `{ "monitor" ], "summary": "Resource monitoring information loading", + "parameters": [ + { + "enum": [ + "all", + "load", + "cpu", + "memory", + "io", + "network" + ], + "type": "string", + "default": "all", + "description": "Data Type", + "name": "type", + "in": "query", + "required": true + }, + { + "type": "number", + "default": 1738771200000, + "description": "StartTime, timestamp milliseconds", + "name": "startTime", + "in": "query", + "required": true + }, + { + "type": "number", + "default": 1738810051253, + "description": "EndTime, timestamp milliseconds", + "name": "endTime", + "in": "query", + "required": true + }, + { + "type": "string", + "default": "#", + "description": "NE Type, Currently none Default #", + "name": "neType", + "in": "query" + }, + { + "type": "string", + "default": "#", + "description": "NE ID, Currently none Default #", + "name": "neId", + "in": "query" + }, + { + "type": "string", + "description": "Name, Data Type valid for networ and io", + "name": "name", + "in": "query" + } + ], "responses": { "200": { "description": "Response Results", @@ -2527,6 +2581,7 @@ const docTemplate = `{ "SGWC" ], "type": "string", + "default": "AMF", "description": "NE Type", "name": "neType", "in": "query", @@ -2542,7 +2597,7 @@ const docTemplate = `{ }, { "type": "number", - "default": 1737453599059, + "default": 1729162507596, "description": "Start time (timestamped milliseconds)", "name": "startTime", "in": "query", @@ -2550,7 +2605,7 @@ const docTemplate = `{ }, { "type": "number", - "default": 1737453599059, + "default": 1729164187611, "description": "End time (timestamped milliseconds)", "name": "endTime", "in": "query", @@ -2570,6 +2625,7 @@ const docTemplate = `{ 3600 ], "type": "number", + "default": 60, "description": "interval", "name": "interval", "in": "query", @@ -2622,6 +2678,7 @@ const docTemplate = `{ "SGWC" ], "type": "string", + "default": "AMF", "description": "NE Type", "name": "neType", "in": "query", @@ -3722,7 +3779,7 @@ const docTemplate = `{ }, { "type": "number", - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "num", "in": "path", "required": true @@ -3810,7 +3867,7 @@ const docTemplate = `{ }, { "type": "number", - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "value", "in": "path", "required": true @@ -4188,7 +4245,7 @@ const docTemplate = `{ }, { "type": "number", - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "num", "in": "path", "required": true @@ -4277,7 +4334,7 @@ const docTemplate = `{ { "type": "number", "default": 1, - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "value", "in": "path", "required": true diff --git a/swagger2docs/swagger.json b/swagger2docs/swagger.json index 463c588c..a495f912 100644 --- a/swagger2docs/swagger.json +++ b/swagger2docs/swagger.json @@ -558,6 +558,60 @@ "monitor" ], "summary": "Resource monitoring information loading", + "parameters": [ + { + "enum": [ + "all", + "load", + "cpu", + "memory", + "io", + "network" + ], + "type": "string", + "default": "all", + "description": "Data Type", + "name": "type", + "in": "query", + "required": true + }, + { + "type": "number", + "default": 1738771200000, + "description": "StartTime, timestamp milliseconds", + "name": "startTime", + "in": "query", + "required": true + }, + { + "type": "number", + "default": 1738810051253, + "description": "EndTime, timestamp milliseconds", + "name": "endTime", + "in": "query", + "required": true + }, + { + "type": "string", + "default": "#", + "description": "NE Type, Currently none Default #", + "name": "neType", + "in": "query" + }, + { + "type": "string", + "default": "#", + "description": "NE ID, Currently none Default #", + "name": "neId", + "in": "query" + }, + { + "type": "string", + "description": "Name, Data Type valid for networ and io", + "name": "name", + "in": "query" + } + ], "responses": { "200": { "description": "Response Results", @@ -2525,6 +2579,7 @@ "SGWC" ], "type": "string", + "default": "AMF", "description": "NE Type", "name": "neType", "in": "query", @@ -2540,7 +2595,7 @@ }, { "type": "number", - "default": 1737453599059, + "default": 1729162507596, "description": "Start time (timestamped milliseconds)", "name": "startTime", "in": "query", @@ -2548,7 +2603,7 @@ }, { "type": "number", - "default": 1737453599059, + "default": 1729164187611, "description": "End time (timestamped milliseconds)", "name": "endTime", "in": "query", @@ -2568,6 +2623,7 @@ 3600 ], "type": "number", + "default": 60, "description": "interval", "name": "interval", "in": "query", @@ -2620,6 +2676,7 @@ "SGWC" ], "type": "string", + "default": "AMF", "description": "NE Type", "name": "neType", "in": "query", @@ -3720,7 +3777,7 @@ }, { "type": "number", - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "num", "in": "path", "required": true @@ -3808,7 +3865,7 @@ }, { "type": "number", - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "value", "in": "path", "required": true @@ -4186,7 +4243,7 @@ }, { "type": "number", - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "num", "in": "path", "required": true @@ -4275,7 +4332,7 @@ { "type": "number", "default": 1, - "description": "Number includes starting imsi", + "description": "Number of releases, value includes start imsi", "name": "value", "in": "path", "required": true diff --git a/swagger2docs/swagger.yaml b/swagger2docs/swagger.yaml index 6a364dfb..70ce0ad4 100644 --- a/swagger2docs/swagger.yaml +++ b/swagger2docs/swagger.yaml @@ -341,6 +341,46 @@ paths: consumes: - application/json description: Resource monitoring information loading + parameters: + - default: all + description: Data Type + enum: + - all + - load + - cpu + - memory + - io + - network + in: query + name: type + required: true + type: string + - default: 1738771200000 + description: StartTime, timestamp milliseconds + in: query + name: startTime + required: true + type: number + - default: 1738810051253 + description: EndTime, timestamp milliseconds + in: query + name: endTime + required: true + type: number + - default: '#' + description: 'NE Type, Currently none Default #' + in: query + name: neType + type: string + - default: '#' + description: 'NE ID, Currently none Default #' + in: query + name: neId + type: string + - description: Name, Data Type valid for networ and io + in: query + name: name + type: string produces: - application/json responses: @@ -1626,7 +1666,8 @@ paths: - application/json description: Access to statistical data parameters: - - description: NE Type + - default: AMF + description: NE Type enum: - IMS - AMF @@ -1651,19 +1692,20 @@ paths: name: neId required: true type: string - - default: 1737453599059 + - default: 1729162507596 description: Start time (timestamped milliseconds) in: query name: startTime required: true type: number - - default: 1737453599059 + - default: 1729164187611 description: End time (timestamped milliseconds) in: query name: endTime required: true type: number - - description: interval + - default: 60 + description: interval enum: - 5 - 10 @@ -1697,7 +1739,8 @@ paths: - application/json description: Get Statistical Headings parameters: - - description: NE Type + - default: AMF + description: NE Type enum: - IMS - AMF @@ -2306,7 +2349,7 @@ paths: name: imsi required: true type: string - - description: Number includes starting imsi + - description: Number of releases, value includes start imsi in: path name: num required: true @@ -2391,7 +2434,7 @@ paths: name: neId required: true type: string - - description: Number includes starting imsi + - description: Number of releases, value includes start imsi in: path name: value required: true @@ -2602,7 +2645,7 @@ paths: name: imsi required: true type: string - - description: Number includes starting imsi + - description: Number of releases, value includes start imsi in: path name: num required: true @@ -2688,7 +2731,7 @@ paths: required: true type: string - default: 1 - description: Number includes starting imsi + description: Number of releases, value includes start imsi in: path name: value required: true