api-datamanager/Modules/Interface/InterfaceUtils.py

19 lines
481 B
Python

from DBHelper.MongoHelperInstance import DB_TEST
from Utils.CommonUtil import CommonUtils
class InterfaceUtils(object):
@staticmethod
def make_new_cid():
new_cid = CommonUtils.random_code(8)
case = DB_TEST.find_single_column(
"模型数据",
"计算函数",
{"函数ID": new_cid},
"函数ID"
) is not None
while case:
new_cid = CommonUtils.random_code(8)
return new_cid