110 lines
3.2 KiB
Go
110 lines
3.2 KiB
Go
package web_detailnav
|
|
|
|
import (
|
|
"videoweb/pub/common"
|
|
"videoweb/pub/common/srvdef"
|
|
"videoweb/web/service/srv_detailnav"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// DetailNavList
|
|
// @Tags 详情页导航配置
|
|
// @Summary 详情页导航配置-列表
|
|
// @Description 详情页导航配置-列表
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body srv_detailnav.GetDetailNavListReq true "参数列表"
|
|
// @Success 200 {object} srv_detailnav.GetDetailNavListResp "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Security ApiKeyAuth
|
|
// @Router /api/web/detailnav/list [POST]
|
|
func DetailNavList(c *gin.Context) {
|
|
var req srv_detailnav.GetDetailNavListReq
|
|
if err := c.ShouldBind(&req); err != nil {
|
|
common.ServerJSON(c, srvdef.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
resp, serr := srv_detailnav.GetDetailNavList(c, &req)
|
|
if serr != nil {
|
|
common.ServerJSON(c, serr.Code, "")
|
|
return
|
|
}
|
|
common.ServerJSON(c, srvdef.Success, resp)
|
|
}
|
|
|
|
// DetailNavAdd
|
|
// @Tags 详情页导航配置
|
|
// @Summary 详情页导航配置-增加
|
|
// @Description 详情页导航配置-增加
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body srv_detailnav.AddDetailNavReq true "参数列表"
|
|
// @Success 200 {object} string "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Security ApiKeyAuth
|
|
// @Router /api/web/detailnav/add [POST]
|
|
func DetailNavAdd(c *gin.Context) {
|
|
var req srv_detailnav.AddDetailNavReq
|
|
if err := c.ShouldBind(&req); err != nil {
|
|
common.ServerJSON(c, srvdef.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
serr := srv_detailnav.AddDetailNav(c, &req)
|
|
if serr != nil {
|
|
common.ServerJSON(c, serr.Code, "")
|
|
return
|
|
}
|
|
common.ServerJSON(c, srvdef.Success, "")
|
|
}
|
|
|
|
// DetailNavDel
|
|
// @Tags 详情页导航配置
|
|
// @Summary 详情页导航配置-删除
|
|
// @Description 详情页导航配置-删除
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body srv_detailnav.DelDetailNavReq true "参数列表"
|
|
// @Success 200 {object} string "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Security ApiKeyAuth
|
|
// @Router /api/web/detailnav/del [POST]
|
|
func DetailNavDel(c *gin.Context) {
|
|
var req srv_detailnav.DelDetailNavReq
|
|
if err := c.ShouldBind(&req); err != nil {
|
|
common.ServerJSON(c, srvdef.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
serr := srv_detailnav.DelDetailNav(c, &req)
|
|
if serr != nil {
|
|
common.ServerJSON(c, serr.Code, "")
|
|
return
|
|
}
|
|
common.ServerJSON(c, srvdef.Success, "")
|
|
}
|
|
|
|
// DetailNavUpdate
|
|
// @Tags 详情页导航配置
|
|
// @Summary 详情页导航配置-更新
|
|
// @Description 详情页导航配置-更新
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body srv_detailnav.UpdateDetailNavReq true "参数列表"
|
|
// @Success 200 {object} string "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Security ApiKeyAuth
|
|
// @Router /api/web/detailnav/update [POST]
|
|
func DetailNavUpdate(c *gin.Context) {
|
|
var req srv_detailnav.UpdateDetailNavReq
|
|
if err := c.ShouldBind(&req); err != nil {
|
|
common.ServerJSON(c, srvdef.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
serr := srv_detailnav.UpdateDetailNav(c, &req)
|
|
if serr != nil {
|
|
common.ServerJSON(c, serr.Code, "")
|
|
return
|
|
}
|
|
common.ServerJSON(c, srvdef.Success, "")
|
|
}
|