mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 08:56:42 +08:00
fix: add create_date field to APIKeyResponse for token list display (#17186)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user