chore: opt settings code

This commit is contained in:
engigu
2025-12-21 10:23:25 +08:00
parent 432c57e862
commit c06030fe27
28 changed files with 535 additions and 187 deletions
+20
View File
@@ -0,0 +1,20 @@
package models
import (
"baihu/internal/constant"
)
// LoginLog 登录日志
type LoginLog struct {
ID uint `json:"id" gorm:"primaryKey"`
Username string `json:"username" gorm:"size:100;index;not null"`
IP string `json:"ip" gorm:"size:50"`
UserAgent string `json:"user_agent" gorm:"size:500"`
Status string `json:"status" gorm:"size:20"` // success, failed
Message string `json:"message" gorm:"size:255"`
CreatedAt LocalTime `json:"created_at" gorm:"index"`
}
func (LoginLog) TableName() string {
return constant.TablePrefix + "login_logs"
}