def get_new_projects_datas(datas_len):
    db = HandleDB()
    while True:
        datas = __generator_string(datas_len)
        count = db.get_count(
            'SELECT * FROM tb_projects WHERE name="{}"'.format(datas))
        if count == 0:
            db.close()
            return datas
def get_new_username(username_len):
    db = HandleDB()
    while True:
        username = __generator_string(username_len)
        count = db.get_count(
            'select * from auth_user where username="******"'.format(username))
        if count == 0:
            db.close()
            return username
def get_new_interfaces_name(name_len):
    db = HandleDB()
    while True:
        interface_name = __generator_string(name_len)
        count = db.get_count(
            'select * from tb_interfaces where `name`="{}"'.format(
                interface_name))
        if count == 0:
            db.close()
            return interface_name
def get_new_email():
    db = HandleDB()
    while True:
        # 1生成
        email = __generator_email()
        # 2校验,有
        count = db.get_count(
            'select * from auth_user where email="{}"'.format(email))
        if count == 0:  # 如果email没有在数据库查到。表示是未注册的email。
            db.close()
            return email