Merge branch 'refs/heads/feat-cmd' into release

This commit is contained in:
junleea 2025-03-11 15:35:34 +08:00
commit 0fc72a86d6
1 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package handler
import (
"github.com/gin-gonic/gin"
"log"
"videoplayer/proto"
"videoplayer/service"
)
@ -73,7 +72,7 @@ func (s *ShellHandler) UpdateShell(c *gin.Context) {
c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()})
} else {
var resp []UpdateShellResp
log.Println("UpdateShellReqData:", req.Shells)
//log.Println("UpdateShellReqData:", req.Shells)
for _, v := range req.Shells {
if service.UpdateShellByID(v.ID, uint(id), v.ShellName, v.ShellContent, v.Server, v.Status, v.ShellResult) {
resp = append(resp, UpdateShellResp{ID: v.ID, Status: v.Status})
@ -96,7 +95,7 @@ func (s *ShellHandler) ServerWillRun(c *gin.Context) {
if err := c.ShouldBind(&req); err != nil {
c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()})
} else {
log.Printf("ServerWillRunReq:%s,id:%d", req.Server, id)
//log.Printf("ServerWillRunReq:%s,id:%d", req.Server, id)
willRunShells, err2 := service.FindShellWillRunByServer(req.Server, id)
if err2 != nil {
c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "获取失败", "data": err2.Error()})