Skip to content

Commit e2cc1bb

Browse files
authored
Merge pull request #58 from tbphp/fix-key-len
fix: 修改Key长度为1024
2 parents dd43bb8 + a1f5547 commit e2cc1bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/models/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type Group struct {
6262
// APIKey 对应 api_keys 表
6363
type APIKey struct {
6464
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
65-
KeyValue string `gorm:"type:varchar(512);not null;uniqueIndex:idx_group_key" json:"key_value"`
65+
KeyValue string `gorm:"type:varchar(1024);not null;uniqueIndex:idx_group_key" json:"key_value"`
6666
GroupID uint `gorm:"not null;uniqueIndex:idx_group_key" json:"group_id"`
6767
Status string `gorm:"type:varchar(50);not null;default:'active'" json:"status"`
6868
RequestCount int64 `gorm:"not null;default:0" json:"request_count"`
@@ -78,9 +78,9 @@ type RequestLog struct {
7878
Timestamp time.Time `gorm:"not null;index" json:"timestamp"`
7979
GroupID uint `gorm:"not null;index" json:"group_id"`
8080
GroupName string `gorm:"type:varchar(255);index" json:"group_name"`
81-
KeyValue string `gorm:"type:varchar(512)" json:"key_value"`
81+
KeyValue string `gorm:"type:varchar(1024)" json:"key_value"`
8282
IsSuccess bool `gorm:"not null" json:"is_success"`
83-
SourceIP string `gorm:"type:varchar(45)" json:"source_ip"`
83+
SourceIP string `gorm:"type:varchar(64)" json:"source_ip"`
8484
StatusCode int `gorm:"not null" json:"status_code"`
8585
RequestPath string `gorm:"type:varchar(500)" json:"request_path"`
8686
Duration int64 `gorm:"not null" json:"duration_ms"`

0 commit comments

Comments
 (0)