
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Com.FirmLib.CacheData;
using Com.FirmLib.Entity;
using FirmHttpDao;

namespace Com.FirmLib.Bll
{
    /// <summary>
    /// 资产信息
    /// </summary>
    public class AssetBll : BaseHttpBll
    {
        public AssetBll() : base(@"")
        { }
        /// <summary>
        /// 获取资产地址
        /// </summary>
        /// <param name="assetItem">资产信息</param>
        /// <returns></returns>
        public string GetAssetUrl(AssetItem assetItem)
        {
            string secret = PlatformProjectManager.GetProjectPassword(assetItem.ProjectId);
            var url =
                    $"{BllHttpSetting.Instance.H5Url}/details?perjectId={assetItem.ProjectId}&secret={secret}&FmId={assetItem.Id}&type=1&code={assetItem.FamilyCode}";
            return url;
        }
        /// <summary>
        /// 获取设备显示地址
        /// </summary>
        /// <param name="assetItem"></param>
        /// <returns></returns>
        public string GetEquipmentUrl(AssetItem assetItem)
        {
            string secret = PlatformProjectManager.GetProjectPassword(assetItem.ProjectId);
            var url =
                    $"{BllHttpSetting.Instance.H5Url}/details?perjectId={assetItem.ProjectId}&secret={secret}&FmId={assetItem.Id}&type=0&code={assetItem.FamilyCode}";
            return url;
        }
    }
}
