You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
using AIK.Common.Enum;
|
|
using AIK.Service.IService;
|
|
using AIK.Service.Service;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AIK.Service.Extensions
|
|
{
|
|
public class FileServiceFactory : IFileServiceFactory
|
|
{
|
|
private readonly FileOBDService _obdService;
|
|
private readonly FileBinService _binService;
|
|
private readonly FileCloudDataService _cloudDataService;
|
|
|
|
public FileServiceFactory(FileOBDService obdService, FileBinService binService, FileCloudDataService cloudDataService)
|
|
{
|
|
_obdService = obdService;
|
|
_binService = binService;
|
|
_cloudDataService = cloudDataService;
|
|
}
|
|
|
|
public IFileCacheService GetService(FileServiceType type) => type switch
|
|
{
|
|
FileServiceType.BIN => _binService,
|
|
FileServiceType.OBD => _obdService,
|
|
FileServiceType.CloudData => _cloudDataService,
|
|
_ => throw new ArgumentException("Unsupported type")
|
|
};
|
|
}
|
|
}
|
|
|