From 03e583f9bcb92ec77330beb5059ed4d2a921e738 Mon Sep 17 00:00:00 2001 From: euvre <93761161+euvre@users.noreply.github.com> Date: Wed, 22 Jul 2026 12:08:16 +0800 Subject: [PATCH] fix: add create_date field to APIKeyResponse for token list display (#17186) --- internal/service/api_token.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/internal/service/api_token.go b/internal/service/api_token.go index 7c9dd33b44..77a4164c8d 100644 --- a/internal/service/api_token.go +++ b/internal/service/api_token.go @@ -20,17 +20,20 @@ import ( "ragflow/internal/dao" "ragflow/internal/entity" "ragflow/internal/utility" + "time" ) // APIKeyResponse key response type APIKeyResponse struct { - TenantID string `json:"tenant_id"` - Token string `json:"token"` - DialogID *string `json:"dialog_id,omitempty"` - Source *string `json:"source,omitempty"` - Beta *string `json:"beta,omitempty"` - CreateTime *int64 `json:"create_time,omitempty"` - UpdateTime *int64 `json:"update_time,omitempty"` + TenantID string `json:"tenant_id"` + Token string `json:"token"` + DialogID *string `json:"dialog_id,omitempty"` + Source *string `json:"source,omitempty"` + Beta *string `json:"beta,omitempty"` + CreateTime *int64 `json:"create_time,omitempty"` + CreateDate *time.Time `json:"create_date,omitempty"` + UpdateTime *int64 `json:"update_time,omitempty"` + UpdateDate *time.Time `json:"update_date,omitempty"` } // ListAPIKeys list all API keys for a tenant @@ -64,7 +67,9 @@ func (s *SystemService) ListAPIKeys(tenantID string) ([]*APIKeyResponse, error) Source: key.Source, Beta: beta, CreateTime: key.CreateTime, + CreateDate: key.CreateDate, UpdateTime: key.UpdateTime, + UpdateDate: key.UpdateDate, } } @@ -103,7 +108,9 @@ func (s *SystemService) CreateAPIKey(tenantID string, req *CreateAPIKeyRequest) Source: APIKeyData.Source, Beta: APIKeyData.Beta, CreateTime: APIKeyData.CreateTime, + CreateDate: APIKeyData.CreateDate, UpdateTime: APIKeyData.UpdateTime, + UpdateDate: APIKeyData.UpdateDate, }, nil }