From 4270e777808c237f5f0a6450ba45e3cbfca6b2f6 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Mon, 3 Mar 2025 23:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dshell=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/shell.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/handler/shell.go b/handler/shell.go index 428ddca..5be9ba6 100644 --- a/handler/shell.go +++ b/handler/shell.go @@ -58,16 +58,16 @@ func (s *ShellHandler) CreateShell(c *gin.Context) { } func (s *ShellHandler) ListShell(c *gin.Context) { - user_id, _ := c.Get("id") - id := int(user_id.(float64)) + userId, _ := c.Get("id") + id := int(userId.(float64)) shells := service.FindShellByAuthID(id) c.JSON(200, gin.H{"code": proto.SuccessCode, "message": "获取成功", "data": shells}) } func (s *ShellHandler) UpdateShell(c *gin.Context) { var req UpdateShellReqV2 - user_id, _ := c.Get("id") - id := int(user_id.(float64)) + userId, _ := c.Get("id") + id := int(userId.(float64)) if err := c.ShouldBindJSON(&req); err != nil { c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()}) } else { @@ -88,8 +88,8 @@ type ServerWillRunReq struct { } func (s *ShellHandler) ServerWillRun(c *gin.Context) { - user_id, _ := c.Get("id") - id := int(user_id.(float64)) + userId, _ := c.Get("id") + id := int(userId.(float64)) var req ServerWillRunReq if err := c.ShouldBindJSON(&req); err != nil { c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()})