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)
