Quellcode durchsuchen

feat(model): 为 GlobalLimit 结构体的 State 字段添加默认值

- 在 GlobalLimit 结构体中,将 State 字段的定义修改为包含默认值 true- 这样做可以确保在创建新记录时,State 字段
fusu vor 1 Monat
Ursprung
Commit
1e8f49d752
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      internal/model/globallimit.go

+ 1 - 1
internal/model/globallimit.go

@@ -12,7 +12,7 @@ type GlobalLimit struct {
 	CdnUid          int
 	GatewayGroupId  int
 	Comment         string
-	State         bool
+	State         bool `gorm:"column:state" default:"true"`
 	ExpiredAt       int64
 	createdAt       time.Time
 	updatedAt       time.Time