소스 검색

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

- 在 GlobalLimit 结构体中,将 State 字段的定义修改为包含默认值 true- 这样做可以确保在创建新记录时,State 字段
fusu 1 개월 전
부모
커밋
1e8f49d752
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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