循环引用get_uid处理

This commit is contained in:
Àî×ÚÕñ 2022-08-18 11:11:20 +08:00
parent 6d12abe4f3
commit 8eb8da852c
8 changed files with 21 additions and 13 deletions

View File

@ -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):

View File

@ -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):

View File

@ -4,8 +4,6 @@ from crud.base import CRUDBase
__all__ = 'event_point',
from utils import get_uid
class CRUDProjectNumber(CRUDBase):
# 获取对应游戏的数据,默认把基础属性的数据也获取出来

View File

@ -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):

View File

@ -4,8 +4,6 @@ from crud.base import CRUDBase
__all__ = 'project_number',
from utils import get_uid
class CRUDProjectNumber(CRUDBase):
# 获取所有数据

View File

@ -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):

View File

@ -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):

View File

@ -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):