diff --git a/server/adminserver/api/v1/system/gameswitch.go b/server/adminserver/api/v1/system/gameswitch.go index 87083fe2..ec949649 100644 --- a/server/adminserver/api/v1/system/gameswitch.go +++ b/server/adminserver/api/v1/system/gameswitch.go @@ -81,6 +81,7 @@ func (this *GameSwitchApi) List(c *gin.Context) { if exist { p.Remark = desc } + p.AuditOpen = q5.SafeToInt32(pg.Rows.GetByName("audit_is_open")) p.CreateTime = q5.SafeToInt32(pg.Rows.GetByName("createtime")) p.ModifyTime = q5.SafeToInt32(pg.Rows.GetByName("modifytime")) } @@ -137,9 +138,10 @@ func (this *GameSwitchApi) Add(c *gin.Context) { func (this *GameSwitchApi) Edit(c *gin.Context) { req := struct { - Name string `binding:"required" json:"switch_name"` - Open *int32 `binding:"required" json:"is_open"` - Remark string `json:"remark"` + Name string `binding:"required" json:"switch_name"` + Open *int32 `binding:"required" json:"is_open"` + AuditOpen *int32 `binding:"required" json:"audit_is_open"` + Remark string `json:"remark"` }{} if err := c.ShouldBindJSON(&req); err != nil { c.JSON(http.StatusOK, gin.H{ @@ -168,6 +170,7 @@ func (this *GameSwitchApi) Edit(c *gin.Context) { nowDaySeconds := int32(f5.GetApp().GetRealSeconds()) gswitch.Opened = *req.Open + gswitch.AuditOpen = *req.AuditOpen gswitch.ModifyTime = nowDaySeconds if err := db.Where("switch_name = ?", req.Name).Save(gswitch).Error; err != nil { c.JSON(http.StatusOK, gin.H{ diff --git a/server/adminserver/model/system/gameswitch.go b/server/adminserver/model/system/gameswitch.go index eb84f178..a23373dd 100644 --- a/server/adminserver/model/system/gameswitch.go +++ b/server/adminserver/model/system/gameswitch.go @@ -4,6 +4,7 @@ type GameSwitch struct { Idx int64 `gorm:"uniqueIndex;comment:idx" json:"idx"` Name string `gorm:"column:switch_name" json:"switch_name"` Opened int32 `gorm:"column:is_open" json:"is_open"` + AuditOpen int32 `gorm:"column:audit_is_open" json:"audit_is_open"` CreateTime int32 `gorm:"column:createtime" json:"createtime"` ModifyTime int32 `gorm:"column:modifytime" json:"modifytime"` }