2025-12-26 15:40:24 +08:00
|
|
|
package service
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
2026-01-04 19:27:53 +08:00
|
|
|
type APIKey struct {
|
2025-12-26 15:40:24 +08:00
|
|
|
ID int64
|
|
|
|
|
UserID int64
|
|
|
|
|
Key string
|
|
|
|
|
Name string
|
|
|
|
|
GroupID *int64
|
|
|
|
|
Status string
|
|
|
|
|
CreatedAt time.Time
|
|
|
|
|
UpdatedAt time.Time
|
|
|
|
|
User *User
|
|
|
|
|
Group *Group
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-04 19:27:53 +08:00
|
|
|
func (k *APIKey) IsActive() bool {
|
2025-12-26 15:40:24 +08:00
|
|
|
return k.Status == StatusActive
|
|
|
|
|
}
|