调整
This commit is contained in:
parent
ab8dc43c19
commit
3833918e5f
@ -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{
|
||||
|
@ -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"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user