diff --git a/crud/crud_api_board.py b/crud/crud_api_board.py index 28b2a93..161d165 100644 --- a/crud/crud_api_board.py +++ b/crud/crud_api_board.py @@ -6,7 +6,7 @@ __all__ = 'api_board', from schemas import ProjectDB -from utils import get_uid + class CRUDProjectNumber(CRUDBase): # 获取所有数据 async def all_api(self, db: AsyncIOMotorDatabase): diff --git a/crud/crud_api_list.py b/crud/crud_api_list.py index 9275edd..346ee3e 100644 --- a/crud/crud_api_list.py +++ b/crud/crud_api_list.py @@ -1,11 +1,13 @@ from motor.motor_asyncio import AsyncIOMotorDatabase - +import time, random import schemas from crud.base import CRUDBase __all__ = 'api_list', -from utils import get_uid + +def get_uid(): + return hex(int(time.time() * 10 ** 7) + random.randint(0, 10000))[2:] class CRUDApiList(CRUDBase): diff --git a/crud/crud_event_point.py b/crud/crud_event_point.py index 26e2409..27cd702 100644 --- a/crud/crud_event_point.py +++ b/crud/crud_event_point.py @@ -4,8 +4,6 @@ from crud.base import CRUDBase __all__ = 'event_point', -from utils import get_uid - class CRUDProjectNumber(CRUDBase): # 获取对应游戏的数据,默认把基础属性的数据也获取出来 diff --git a/crud/crud_project.py b/crud/crud_project.py index a3873ec..17e74a8 100644 --- a/crud/crud_project.py +++ b/crud/crud_project.py @@ -1,3 +1,4 @@ +import time, random from motor.motor_asyncio import AsyncIOMotorDatabase from crud.base import CRUDBase @@ -5,7 +6,9 @@ from schemas import * __all__ = 'project', -from utils import get_uid + +def get_uid(): + return hex(int(time.time() * 10 ** 7) + random.randint(0, 10000))[2:] class CRUDProject(CRUDBase): diff --git a/crud/crud_project_number.py b/crud/crud_project_number.py index b375841..cb84024 100644 --- a/crud/crud_project_number.py +++ b/crud/crud_project_number.py @@ -4,8 +4,6 @@ from crud.base import CRUDBase __all__ = 'project_number', -from utils import get_uid - class CRUDProjectNumber(CRUDBase): # 获取所有数据 diff --git a/crud/crud_space.py b/crud/crud_space.py index bec447b..917da9c 100644 --- a/crud/crud_space.py +++ b/crud/crud_space.py @@ -1,3 +1,4 @@ +import time, random import pymongo from motor.motor_asyncio import AsyncIOMotorDatabase @@ -7,7 +8,9 @@ from schemas import * __all__ = 'space', -from utils import get_uid + +def get_uid(): + return hex(int(time.time() * 10 ** 7) + random.randint(0, 10000))[2:] class CRUDSpace(CRUDBase): diff --git a/crud/crud_user.py b/crud/crud_user.py index 3dd2474..e327659 100644 --- a/crud/crud_user.py +++ b/crud/crud_user.py @@ -1,6 +1,6 @@ import datetime import time -import uuid +import random from motor.motor_asyncio import AsyncIOMotorDatabase @@ -12,7 +12,9 @@ from schemas import UserCreate, UserDBRW __all__ = 'user', -from utils import get_uid + +def get_uid(): + return hex(int(time.time() * 10 ** 7) + random.randint(0, 10000))[2:] class CRUDUser(CRUDBase): diff --git a/crud/user_label.py b/crud/user_label.py index 7d6c005..e457444 100644 --- a/crud/user_label.py +++ b/crud/user_label.py @@ -1,11 +1,13 @@ from motor.motor_asyncio import AsyncIOMotorDatabase - +import time, random import schemas from crud.base import CRUDBase __all__ = 'user_label', -from utils import get_uid + +def get_uid(): + return hex(int(time.time() * 10 ** 7) + random.randint(0, 10000))[2:] class CRUDUserLabel(CRUDBase):