mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-28 15:10:02 +00:00
23 lines
327 B
Python
23 lines
327 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import datetime
|
|
import uuid
|
|
|
|
|
|
def get_uuid() -> str:
|
|
"""
|
|
生成uuid
|
|
|
|
:return: str(uuid)
|
|
"""
|
|
return str(uuid.uuid4())
|
|
|
|
|
|
def get_current_timestamp() -> float:
|
|
"""
|
|
生成当前时间戳
|
|
|
|
:return:
|
|
"""
|
|
return datetime.datetime.now().timestamp()
|