using LCU.API.Internal.Operations.IncentiveApi.DataAccess; using LCU.Library.Internal.Exceptions; using LCU.Library.Internal.FileOperationsModels.Models; namespace LCU.API.Internal.Operations.IncentiveApi.Services.MicroApiServices; public class FileOperationsApiService : IFileOperationsApiService { private readonly IFileOperationsApiDao _fileOperationDao; public FileOperationsApiService(IFileOperationsApiDao fileOperationDao) { _fileOperationDao = fileOperationDao; } public async Task BuildDynamicFileList(DynamicFileListRequest dynamicFileRequest) { try { return await _fileOperationDao.BuildDynamicFileList(dynamicFileRequest); } catch (Exception exception) { var message = $"Error to BuildDynamicFileList. FilePath: {dynamicFileRequest.Path}."; Log.Error(exception, message); throw new ServiceException($"{message} Exception Message:{exception.Message}"); } } public async Task GetFileContent(string filePath) { try { return await _fileOperationDao.GetFileContent(filePath); } catch (Exception exception) { var message = $"Failure to GetFileContent. FilePath: {filePath}."; Log.Error(exception, message); throw new ServiceException($"{message} Exception Message: {exception.Message}"); } } }