using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Com.FirmLib.Bll;
using FWindSoft.DataFramework;

namespace Com.FirmLib.CacheData
{
    /// <summary>
    /// 数据平台数据管理
    /// </summary>
    public class PlatformProjectManager
    {
        private static readonly Dictionary<string, string> m_DicSecret = new Dictionary<string, string>();

        public static string GetProjectPassword(string projecId)
        {
            if (string.IsNullOrEmpty(projecId))
                return string.Empty;
            if (m_DicSecret.TryGetValue(projecId, out string secret))
            {
                return secret;
            }

            var result = BllFactory<ProjectBll>.Instance.GetProjectSecret(projecId);
            if (!string.IsNullOrEmpty(result))
            {
                m_DicSecret[projecId] = result;
            }
            return result;
        }
    }
}
