调整
This commit is contained in:
parent
2b1ceec576
commit
f295141c04
@ -9,6 +9,7 @@ import (
|
|||||||
"main/mt"
|
"main/mt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"q5"
|
"q5"
|
||||||
|
"sort"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@ -145,7 +146,7 @@ func (this *GameSwitchApi) Edit(c *gin.Context) {
|
|||||||
req := struct {
|
req := struct {
|
||||||
Name string `binding:"required" json:"switch_name"`
|
Name string `binding:"required" json:"switch_name"`
|
||||||
Open *int32 `binding:"required" json:"is_open"`
|
Open *int32 `binding:"required" json:"is_open"`
|
||||||
Servers []int32 `json:"serverList"`
|
Servers []int `json:"serverList"`
|
||||||
AuditOpen *int32 `binding:"required" json:"audit_is_open"`
|
AuditOpen *int32 `binding:"required" json:"audit_is_open"`
|
||||||
Remark string `json:"remark"`
|
Remark string `json:"remark"`
|
||||||
}{}
|
}{}
|
||||||
@ -177,9 +178,10 @@ func (this *GameSwitchApi) Edit(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort.Ints(req.Servers)
|
||||||
nowDaySeconds := int32(f5.GetApp().GetRealSeconds())
|
nowDaySeconds := int32(f5.GetApp().GetRealSeconds())
|
||||||
gswitch.Opened = *req.Open
|
gswitch.Opened = *req.Open
|
||||||
serverbytes,_ := json.Marshal(req.Servers)
|
serverbytes, _ := json.Marshal(req.Servers)
|
||||||
gswitch.Servers = string(serverbytes)
|
gswitch.Servers = string(serverbytes)
|
||||||
gswitch.AuditOpen = *req.AuditOpen
|
gswitch.AuditOpen = *req.AuditOpen
|
||||||
gswitch.ModifyTime = nowDaySeconds
|
gswitch.ModifyTime = nowDaySeconds
|
||||||
|
Loading…
x
Reference in New Issue
Block a user