Merge branch 'refs/heads/feat-cmd' into release
This commit is contained in:
commit
ab05433289
|
|
@ -58,16 +58,16 @@ func (s *ShellHandler) CreateShell(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ShellHandler) ListShell(c *gin.Context) {
|
func (s *ShellHandler) ListShell(c *gin.Context) {
|
||||||
user_id, _ := c.Get("id")
|
userId, _ := c.Get("id")
|
||||||
id := int(user_id.(float64))
|
id := int(userId.(float64))
|
||||||
shells := service.FindShellByAuthID(id)
|
shells := service.FindShellByAuthID(id)
|
||||||
c.JSON(200, gin.H{"code": proto.SuccessCode, "message": "获取成功", "data": shells})
|
c.JSON(200, gin.H{"code": proto.SuccessCode, "message": "获取成功", "data": shells})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ShellHandler) UpdateShell(c *gin.Context) {
|
func (s *ShellHandler) UpdateShell(c *gin.Context) {
|
||||||
var req UpdateShellReqV2
|
var req UpdateShellReqV2
|
||||||
user_id, _ := c.Get("id")
|
userId, _ := c.Get("id")
|
||||||
id := int(user_id.(float64))
|
id := int(userId.(float64))
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()})
|
c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()})
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -88,8 +88,8 @@ type ServerWillRunReq struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ShellHandler) ServerWillRun(c *gin.Context) {
|
func (s *ShellHandler) ServerWillRun(c *gin.Context) {
|
||||||
user_id, _ := c.Get("id")
|
userId, _ := c.Get("id")
|
||||||
id := int(user_id.(float64))
|
id := int(userId.(float64))
|
||||||
var req ServerWillRunReq
|
var req ServerWillRunReq
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()})
|
c.JSON(200, gin.H{"code": proto.ShellUpdateFailed, "message": "参数错误", "data": err.Error()})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue