select_company_service.py 582 Bytes
Newer Older
lcn's avatar
lcn committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
from unify_api.modules.common.components.select_company_cps import CmRes
from unify_api.modules.common.dao.common_dao import company_model_by_cid


async def company_model_service(cid):
    """智电U首页工厂模型"""
    company_model_dic = await company_model_by_cid(cid)
    if company_model_dic:
        cid = company_model_dic.get("cid")
        model_url = company_model_dic.get("model_url")
        direction = company_model_dic.get("direction")
    else:
        cid, model_url, direction = "", "", ""
    return CmRes(cid=cid, model_url=model_url, direction=direction)