Initial commit: web_hghl_server
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
package web_app
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"videoweb/pub/common"
|
||||
"videoweb/pub/common/log"
|
||||
"videoweb/pub/common/srvdef"
|
||||
"videoweb/pub/pubdef"
|
||||
"videoweb/web/service/srv_app"
|
||||
)
|
||||
|
||||
func AppSyncReq(c *gin.Context) {
|
||||
var in srv_app.AppVideoInfoSyncReq
|
||||
if err := c.ShouldBindJSON(&in); err != nil {
|
||||
common.ServerJSON(c, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
if in.AppId != pubdef.AppId {
|
||||
common.ServerJSON(c, srvdef.APPIDError, nil)
|
||||
}
|
||||
data, err := srv_app.AppVideoInfoSync(c, &in)
|
||||
if err != nil {
|
||||
log.Error("AppSyncReq AppVideoInfoSyncReq Failed", log.Any("err", err))
|
||||
common.ServerJSON(c, err.Code, "")
|
||||
return
|
||||
}
|
||||
|
||||
common.ServerJSON(c, srvdef.Success, data)
|
||||
}
|
||||
|
||||
func AppCollectionSyncReq(c *gin.Context) {
|
||||
var in srv_app.AppVideoCollectionSyncReq
|
||||
if err := c.ShouldBindJSON(&in); err != nil {
|
||||
common.ServerJSON(c, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
if in.AppId != pubdef.AppId {
|
||||
common.ServerJSON(c, srvdef.APPIDError, nil)
|
||||
}
|
||||
data, err := srv_app.AppVideoCollectionSync(c, &in)
|
||||
if err != nil {
|
||||
log.Error("AppCollectionSyncReq AppVideoCollectionSync Failed", log.Any("err", err))
|
||||
common.ServerJSON(c, err.Code, "")
|
||||
return
|
||||
}
|
||||
|
||||
common.ServerJSON(c, srvdef.Success, data)
|
||||
}
|
||||
|
||||
func AppGetVideoCategory(c *gin.Context) {
|
||||
data, err := srv_app.AppCategoryList(c)
|
||||
if err != nil {
|
||||
log.Error("AppGetVideoCategory AppCategoryList Failed", log.Any("err", err))
|
||||
common.ServerJSON(c, err.Code, "")
|
||||
return
|
||||
}
|
||||
common.ServerJSON(c, srvdef.Success, data)
|
||||
}
|
||||
|
||||
func AppGetVideoCreator(c *gin.Context) {
|
||||
data, err := srv_app.AppCreatorList(c)
|
||||
if err != nil {
|
||||
log.Error("AppGetVideoCreator AppCategoryList Failed", log.Any("err", err))
|
||||
common.ServerJSON(c, err.Code, "")
|
||||
return
|
||||
}
|
||||
common.ServerJSON(c, srvdef.Success, data)
|
||||
}
|
||||
|
||||
func AppGetVideoTag(c *gin.Context) {
|
||||
data, err := srv_app.AppTagList(c)
|
||||
if err != nil {
|
||||
log.Error("AppGetVideoTag AppCategoryList Failed", log.Any("err", err))
|
||||
common.ServerJSON(c, err.Code, "")
|
||||
return
|
||||
}
|
||||
common.ServerJSON(c, srvdef.Success, data)
|
||||
}
|
||||
Reference in New Issue
Block a user