feat((model api key) and app):
fix bug
This commit is contained in:
@@ -203,7 +203,7 @@ class AppStatisticsService:
|
|||||||
end_date: 结束时间戳(毫秒)
|
end_date: 结束时间戳(毫秒)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
统计数据字典
|
每日统计数据列表
|
||||||
"""
|
"""
|
||||||
# 将毫秒时间戳转换为 datetime
|
# 将毫秒时间戳转换为 datetime
|
||||||
start_time = datetime.fromtimestamp(start_date / 1000)
|
start_time = datetime.fromtimestamp(start_date / 1000)
|
||||||
|
|||||||
@@ -652,10 +652,12 @@ class ModelApiKeyService:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def record_api_key_usage(db: Session, api_key_id: uuid.UUID | None) -> bool:
|
def record_api_key_usage(db: Session, api_key_id: uuid.UUID | None) -> bool:
|
||||||
"""记录API Key使用"""
|
"""记录API Key使用"""
|
||||||
success = ModelApiKeyRepository.update_usage(db, api_key_id)
|
if not api_key_id:
|
||||||
if success:
|
success = ModelApiKeyRepository.update_usage(db, api_key_id)
|
||||||
db.commit()
|
if success:
|
||||||
return success
|
db.commit()
|
||||||
|
return success
|
||||||
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_a_api_key(db: Session, model_config_id: uuid.UUID) -> ModelApiKey:
|
def get_a_api_key(db: Session, model_config_id: uuid.UUID) -> ModelApiKey:
|
||||||
|
|||||||
Reference in New Issue
Block a user