init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
@@ -0,0 +1,67 @@
package video_activity_ctrl
import (
"fmt"
"91jd-server/common"
"91jd-server/common/log"
"91jd-server/common/stderr"
"91jd-server/web/service/video_activity_service"
"github.com/gin-gonic/gin"
)
// Submit 提交
func Submit(c *gin.Context) {
var in *video_activity_service.SubmitCond
if err := c.ShouldBind(&in); err != nil {
common.ServeJSON(c, stderr.ErrParamError, "web video_activity Submit arg error "+err.Error())
return
}
if code := video_activity_service.Submit(in); code != stderr.Success {
common.ServeJSON(c, code, nil)
return
}
common.ServeJSON(c, stderr.Success, "success")
}
// Edit 修改
func Edit(c *gin.Context) {
var in *video_activity_service.EditCond
if err := c.ShouldBind(&in); err != nil {
common.ServeJSON(c, stderr.ErrParamError, "web video_activity Edit arg error "+err.Error())
return
}
if code := video_activity_service.Edit(in); code != stderr.Success {
common.ServeJSON(c, code, nil)
return
}
common.ServeJSON(c, stderr.Success, "success")
}
// QueryAll 查询
func QueryAll(c *gin.Context) {
var in *video_activity_service.QueryAllCond
log.Info("进入这里")
if err := c.ShouldBindQuery(&in); err != nil {
common.ServeJSON(c, stderr.ErrParamError, "web video_activity QueryAll arg error "+err.Error())
return
}
data, code := video_activity_service.QueryAll(in)
if code != stderr.Success {
log.Info(fmt.Sprintf("%v\n%d", data, code))
common.ServeJSON(c, code, nil)
return
}
log.Info(fmt.Sprintf("%v\n%d", data, code))
common.ServeJSON(c, code, data)
}
func Box(c *gin.Context) {
data, code := video_activity_service.Box()
if code != stderr.Success {
common.ServeJSON(c, code, nil)
return
}
common.ServeJSON(c, code, data)
}