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

@@ -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")