refactor: modularize Beam into new projects and interfaces

- Introduced modularity by splitting Beam into new projects: Beam.Abstractions, Beam.Models, and Beam.Downloaders.
- Refactored existing classes into appropriate namespaces and projects.
- Replaced specific implementations with abstractions (e.g., SourceLinkBuilder to LinkBuilder, State to IState, etc.).
- Updated interfaces: added ITemplate, IArticleData, IDownloadReport, and others for improved extensibility.
- Removed deprecated classes like SourceLinkBuilder and StateChangerFactory.
- Enhanced link handling in downloaders by refactoring to use `string` over `SourceLink`.
- Consolidated shared logic under Beam.Abstractions.
This commit is contained in:
qwsdcvghyu89
2025-09-22 01:51:46 +10:00
parent a7d148a96f
commit 7ed05abdb8
128 changed files with 2058 additions and 1804 deletions
+5 -2
View File
@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Beam.Abstractions;
using Beam.Models;
namespace Beam.Exports {
public class PlainTextExporter : IExporter, IAsyncExporter {
@@ -24,14 +27,14 @@ namespace Beam.Exports {
var text = Convert();
if (!Directory.Exists(Path.GetDirectoryName(path)))
throw new ArgumentException(S.M.FileDirectoryDoesNotExist, nameof(path));
File.WriteAllText(path, text, Encoding.Unicode);
System.IO.File.WriteAllText(path, text, Encoding.Unicode);
}
public virtual async Task WriteAsync(string path) {
var text = await ConvertAsync();
if (!Directory.Exists(path))
throw new ArgumentException(S.M.FileDirectoryDoesNotExist, nameof(path));
await File.WriteAllTextAsync(path, text);
await System.IO.File.WriteAllTextAsync(path, text);
}
}
}