Initial commit: web_hghl_server
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
package web_actress
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"videoweb/pub/common"
|
||||
"videoweb/pub/common/srvdef"
|
||||
"videoweb/web/service/srv_actress"
|
||||
)
|
||||
|
||||
// @Tags 女优管理
|
||||
// @Summary 分组分页获取女优信息
|
||||
// @Description 分组分页获取女优信息
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_actress.ActressListReq true "参数列表"
|
||||
// @Success 200 {object} srv_actress.ActressListResp "成功"
|
||||
// @Failure 400 {string} string "获取失败的返回结果"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/actress/list [GET]
|
||||
func Get(ctx *gin.Context) {
|
||||
var req = &srv_actress.ActressListReq{}
|
||||
if err := ctx.ShouldBind(req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
resp, serr := srv_actress.ActressList(ctx, req)
|
||||
if serr != nil {
|
||||
common.ServerJSON(ctx, serr.Code, serr.Tips)
|
||||
return
|
||||
}
|
||||
|
||||
common.ServerJSON(ctx, srvdef.Success, resp)
|
||||
}
|
||||
|
||||
// @Tags 女优管理
|
||||
// @Summary 添加一个女优信息
|
||||
// @Description 添加一个女优信息
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_actress.ActressAddReq true "参数列表"
|
||||
// @Success 200 {string} string "成功"
|
||||
// @Failure 400 {string} string "获取失败的返回结果"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/actress/add [POST]
|
||||
func Add(ctx *gin.Context) {
|
||||
var req = &srv_actress.ActressAddReq{}
|
||||
if err := ctx.ShouldBind(req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, err)
|
||||
return
|
||||
}
|
||||
serr := srv_actress.AddActress(ctx, req)
|
||||
if serr != nil {
|
||||
common.ServerJSON(ctx, serr.Code, serr.Tips)
|
||||
return
|
||||
}
|
||||
|
||||
common.ServerJSON(ctx, srvdef.Success, "")
|
||||
}
|
||||
|
||||
// @Tags 女优管理
|
||||
// @Summary 删除一个女优信息
|
||||
// @Description 删除一个女优信息
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_actress.ActressDelReq true "参数列表"
|
||||
// @Success 200 {string} string "成功"
|
||||
// @Failure 400 {string} string "获取失败的返回结果"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/actress/del [POST]
|
||||
func Del(ctx *gin.Context) {
|
||||
var req = &srv_actress.ActressDelReq{}
|
||||
if err := ctx.ShouldBind(req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, err)
|
||||
return
|
||||
}
|
||||
serr := srv_actress.DeleteActress(ctx, req)
|
||||
if serr != nil {
|
||||
common.ServerJSON(ctx, serr.Code, serr.Tips)
|
||||
return
|
||||
}
|
||||
|
||||
common.ServerJSON(ctx, srvdef.Success, "")
|
||||
}
|
||||
|
||||
// @Tags 女优管理
|
||||
// @Summary 更新一个女优信息
|
||||
// @Description 更新一个女优信息
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_actress.ActressUpdateReq true "参数列表"
|
||||
// @Success 200 {string} string "成功"
|
||||
// @Failure 400 {string} string "获取失败的返回结果"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/actress/update [POST]
|
||||
func Update(ctx *gin.Context) {
|
||||
var req = &srv_actress.ActressUpdateReq{}
|
||||
if err := ctx.ShouldBind(req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
|
||||
serr := srv_actress.UpdateActress(ctx, req)
|
||||
if serr != nil {
|
||||
common.ServerJSON(ctx, serr.Code, serr.Tips)
|
||||
return
|
||||
}
|
||||
|
||||
common.ServerJSON(ctx, srvdef.Success, "")
|
||||
}
|
||||
Reference in New Issue
Block a user