mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-18 15:00:46 +08:00
23 lines
331 B
Python
23 lines
331 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import datetime
|
|
import uuid
|
|
|
|
|
|
def get_uuid_str() -> str:
|
|
"""
|
|
生成uuid
|
|
|
|
:return: str(uuid)
|
|
"""
|
|
return str(uuid.uuid4())
|
|
|
|
|
|
def get_current_timestamp() -> float:
|
|
"""
|
|
生成当前时间戳
|
|
|
|
:return:
|
|
"""
|
|
return datetime.datetime.now().timestamp()
|