using System.Collections.Generic;
using System.Threading.Tasks;
using YGNT.Infrastructure.Grpc;
using YGNT.Infrastructure.Resource.Model;

namespace YGNT.Infrastructure.Resource
{
    public class ResourceManager : IResourceManager
    {
        /// <summary>
        /// 获取资源详细信息
        /// </summary>
        /// <param name="resourceList"></param>
        /// <returns></returns>
        public async Task<Dictionary<string, ResourceInfo>> GetResourceInfo(List<string> resourceList)
        {
            var dictionary = await Task.Run(() => GrpcResourcesFile.ResourcesFileBaseList(resourceList));
            return dictionary;
        }

        /// <summary>
        /// 获取资源详细信息
        /// </summary>
        /// <param name="resourceId"></param>
        /// <returns></returns>
        public async Task<ResourceInfo> GetResourceInfo(string resourceId)
        {
            return await Task.Run(() => GrpcResourcesFile.ResourcesFileBaseInfo(resourceId));
        }
    }
}