Initial commit: web_hghl_server

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 16:28:14 +08:00
co-authored by Claude Opus 4.7
commit 65fca60622
653 changed files with 135901 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package richtextapi
import (
"videoweb/app/service/richtextser"
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"github.com/gin-gonic/gin"
)
type getByTitleReq struct {
Title string `form:"title" binding:"required"`
}
// GetByTitle 按 title 查询富文本
// @Tags 富文本
// @Summary 按 title 查询富文本
// @Description 从缓存中查询启用状态的富文本信息
// @Produce json
// @Param title query string true "富文本内部标题"
// @Success 200 {object} proto.RichTextInfo "成功"
// @Failure 400 {string} string "失败"
// @Router /api/app/richtext [get]
func GetByTitle(ctx *gin.Context) {
var req getByTitleReq
if err := ctx.ShouldBindQuery(&req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
data, serr := richtextser.GetByTitle(req.Title)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, data)
}