docs: 更新swagger注释信息

This commit is contained in:
TsMask
2025-01-24 20:31:11 +08:00
parent accb761951
commit 56fc427da3
7 changed files with 560 additions and 171 deletions

View File

@@ -80,7 +80,7 @@ func (s *FileController) Download(c *gin.Context) {
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary Upload a file
// @Description Upload a file
// @Description Upload a file, interface param use <fileName>
// @Router /file/upload [post]
func (s *FileController) Upload(c *gin.Context) {
language := ctx.AcceptLanguage(c)

View File

@@ -67,7 +67,11 @@ func (s *UDMAuthController) ResetData(c *gin.Context) {
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Success 200 {object} object "Response Results"
// @Param neId query string true "NE ID" default(001)
// @Param imsi query string false "IMSI"
// @Param pageNum query number true "pageNum" default(1)
// @Param pageSize query number true "pageSize" default(10)
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User List
// @Description UDM Authentication User List
@@ -86,7 +90,7 @@ func (s *UDMAuthController) List(c *gin.Context) {
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param value path string true "User data imsi"
// @Param value path string true "IMSI"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User Information
@@ -201,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 "Incremental number"
// @Param value path number true "Number includes starting imsi"
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
@@ -321,7 +325,7 @@ func (s *UDMAuthController) Edit(c *gin.Context) {
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param value path string true "User data imsi, multiple separated by a , sign"
// @Param value path string true "IMSI, multiple separated by a , sign"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authenticated User Deletion
@@ -385,8 +389,8 @@ func (s *UDMAuthController) Remove(c *gin.Context) {
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param imsi path string true "User data imsi"
// @Param num path number true "Incremental number"
// @Param imsi path string true "IMSI"
// @Param num path number true "Number includes starting imsi"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User Batch Deletion
@@ -438,7 +442,8 @@ func (s *UDMAuthController) Removes(c *gin.Context) {
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Success 200 {object} object "Response Results"
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authenticated User Export
// @Description UDM Authenticated User Export
@@ -534,10 +539,10 @@ func (s *UDMAuthController) Export(c *gin.Context) {
func (s *UDMAuthController) Import(c *gin.Context) {
language := ctx.AcceptLanguage(c)
var body struct {
NeId string `json:"neId" binding:"required"`
UploadPath string `json:"uploadPath" binding:"required"`
TypeVal string `json:"typeVal" binding:"required,oneof=default k4"`
TypeData any `json:"typeData"`
NeId string `json:"neId" binding:"required"` // 网元ID
UploadPath string `json:"uploadPath" binding:"required"` // 上传文件路径
TypeVal string `json:"typeVal" binding:"required,oneof=default k4"` // default: 默认导入方式, k4: k4类型导入方式
TypeData any `json:"typeData"` // k4类型的数据密钥
}
if err := c.ShouldBindBodyWith(&body, binding.JSON); err != nil {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))

View File

@@ -66,7 +66,12 @@ func (s *UDMSubController) ResetData(c *gin.Context) {
// @Tags network_data/udm/sub
// @Accept json
// @Produce json
// @Success 200 {object} object "Response Results"
// @Param neId query string true "NE ID" default(001)
// @Param imsi query string false "IMSI"
// @Param msisdn query string false "Msisdn"
// @Param pageNum query number true "pageNum" default(1)
// @Param pageSize query number true "pageSize" default(10)
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Subscriber User List
// @Description UDM Subscriber User List
@@ -85,7 +90,7 @@ func (s *UDMSubController) List(c *gin.Context) {
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param value path string true "User data imsi"
// @Param value path string true "IMSI"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Subscriber User Information
@@ -200,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 "Incremental number" default(1)
// @Param neId path string true "NE ID" default(001)
// @Param value path number true "Number includes starting imsi" default(1)
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
@@ -325,7 +330,7 @@ func (s *UDMSubController) Edit(c *gin.Context) {
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param value path string true "User data imsi, multiple separated by a , sign"
// @Param value path string true "IMSI, multiple separated by a , sign"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Subscriber User Deletion
@@ -389,8 +394,8 @@ func (s *UDMSubController) Remove(c *gin.Context) {
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param imsi path string true "User data imsi"
// @Param num path number true "Incremental number" default(1)
// @Param imsi path string true "IMSI"
// @Param num path number true "Number includes starting imsi"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Subscriber User Batch Deletion

View File

@@ -12,8 +12,8 @@ import (
neFetchlink "be.ems/src/modules/network_element/fetch_link"
"be.ems/src/modules/network_element/model"
neService "be.ems/src/modules/network_element/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
// 实例化控制层 NeInfoController 结构体
@@ -139,7 +139,11 @@ func (s *NeInfoController) NeTypeAndID(c *gin.Context) {
// @Tags network_element/info
// @Accept json
// @Produce json
// @Success 200 {object} object "Response Results"
// @Param neType query string true "NE Type"
// @Param neId query string true "NE ID" default(001)
// @Param bandStatus query boolean true "With status information"
// @Param bandHost query boolean true "With host information"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary The list of network element information is all unpaginated
// @Description The list of network element information is all unpaginated
@@ -194,7 +198,7 @@ func (s *NeInfoController) Para5GFileWrite(c *gin.Context) {
Content map[string]any `json:"content" binding:"required"` // 内容
SyncNE []string `json:"syncNe"` // 同步到网元
}
if err := c.ShouldBindBodyWith(&body, binding.JSON); err != nil {
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -240,7 +244,7 @@ func (s *NeInfoController) OAMFileWrite(c *gin.Context) {
Content map[string]any `json:"content" binding:"required"` // 内容
Sync bool `json:"sync"` // 同步到网元
}
if err := c.ShouldBindBodyWith(&body, binding.JSON); err != nil {
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -268,6 +272,10 @@ func (s *NeInfoController) OAMFileWrite(c *gin.Context) {
// @Accept json
// @Produce json
// @Param bandStatus query boolean false "The result carries the state of the network element"
// @Param neId query string false "NE ID"
// @Param neType query string false "Ne Type"
// @Param pageNum query number true "pageNum" default(1)
// @Param pageSize query number true "pageSize" default(10)
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary Network element information list
@@ -290,12 +298,12 @@ func (s *NeInfoController) List(c *gin.Context) {
// @Tags network_element/info
// @Accept json
// @Produce json
// @Param infoId path string true "list data id"
// @Param value path string true "Row ID"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary Network element information
// @Description Network element information
// @Router /ne/info/{infoId} [get]
// @Router /ne/info/{value} [get]
func (s *NeInfoController) Info(c *gin.Context) {
language := ctx.AcceptLanguage(c)
infoId := c.Param("infoId")
@@ -330,7 +338,7 @@ func (s *NeInfoController) Info(c *gin.Context) {
func (s *NeInfoController) Add(c *gin.Context) {
language := ctx.AcceptLanguage(c)
var body model.NeInfo
err := c.ShouldBindBodyWith(&body, binding.JSON)
err := c.ShouldBindBodyWithJSON(&body)
if err != nil || body.ID != "" {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
@@ -418,7 +426,7 @@ func (s *NeInfoController) Add(c *gin.Context) {
func (s *NeInfoController) Edit(c *gin.Context) {
language := ctx.AcceptLanguage(c)
var body model.NeInfo
err := c.ShouldBindBodyWith(&body, binding.JSON)
err := c.ShouldBindBodyWithJSON(&body)
if err != nil || body.ID == "" {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
@@ -517,12 +525,12 @@ func (s *NeInfoController) Edit(c *gin.Context) {
// @Tags network_element/info
// @Accept json
// @Produce json
// @Param infoIds path string true "list data id, multiple separated by a , sign"
// @Param value path string true "Row ID, multiple separated by a , sign"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary Network element information deletion
// @Description Network element information deletion
// @Router /ne/{infoIds} [delete]
// @Router /ne/info/{value} [delete]
func (s *NeInfoController) Remove(c *gin.Context) {
language := ctx.AcceptLanguage(c)
infoIds := c.Param("infoIds")