diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 73082bb..6ba79d9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,10 @@
-
+
-
+
+
@@ -153,7 +154,6 @@
-
@@ -178,7 +178,8 @@
-
+
+
true
diff --git a/pkg/internal/models/bot.go b/pkg/internal/models/bot.go
index 9e14bf8..47bdd11 100644
--- a/pkg/internal/models/bot.go
+++ b/pkg/internal/models/bot.go
@@ -8,4 +8,6 @@ type ApiKey struct {
Lifecycle *int64 `json:"lifecycle"`
Ticket AuthTicket `json:"ticket" gorm:"TicketID"`
TicketID uint `json:"ticket_id"`
+ Account Account `json:"account"`
+ AccountID uint `json:"account_id"`
}
diff --git a/pkg/internal/services/bot_token.go b/pkg/internal/services/bot_token.go
index edf5ab4..6880bbb 100644
--- a/pkg/internal/services/bot_token.go
+++ b/pkg/internal/services/bot_token.go
@@ -9,6 +9,9 @@ import (
)
func NewApiKey(user models.Account, key models.ApiKey, ip, ua string, claims []string) (models.ApiKey, error) {
+ key.Account = user
+ key.AccountID = user.ID
+
var expiredAt *time.Time
if key.Lifecycle != nil {
expiredAt = lo.ToPtr(time.Now().Add(time.Duration(*key.Lifecycle) * time.Second))