@@ -56,12 +56,68 @@ public static string GetRepoRawURL()
56
56
}
57
57
}
58
58
59
+ public interface IFastDownloader : IDisposable
60
+ {
61
+ public void Download ( string downloadPath , string file , string LocalPath = "" ) ;
62
+ }
63
+
64
+ public class RepoDownloader ( CodeRepo repo ) : IFastDownloader
65
+ {
66
+ public DirectoryInfo directory ;
67
+ public Repos repoType = repo . repoType ;
68
+ public List < IGet > Gets = [ ] ;
69
+
70
+
71
+ #nullable enable
72
+ private T ? Get < T > ( ) where T : class , IGet , new ( )
73
+ {
74
+ return Gets . FirstOrDefault ( n => n is T ) as T ;
75
+ }
76
+ #nullable disable
77
+
78
+ public RepoDownloader BuildGet ( )
79
+ {
80
+ if ( repoType is Repos . Github )
81
+ {
82
+ Gets . Add ( GithubGet . Get ( repo ) ) ;
83
+ }
84
+
85
+ return this ;
86
+ }
87
+
88
+ public RepoDownloader SetBaseDirectory ( string path )
89
+ {
90
+ directory = new DirectoryInfo ( path ) ;
91
+ return this ;
92
+ }
93
+ public void Download ( string downloadPath , string file , string LocalPath = "" )
94
+ {
95
+
96
+ }
97
+
98
+ public void Dispose ( )
99
+ {
100
+ throw new NotImplementedException ( ) ;
101
+ }
102
+ }
103
+
104
+ public enum Repos
105
+ {
106
+ Github ,
107
+ GitLab ,
108
+ GitCode ,
109
+ Gitee ,
110
+ Gitea ,
111
+ Nuget
112
+ }
113
+
59
114
public sealed class CodeRepo
60
115
{
61
116
public string Url { get ; set ; }
62
117
public string pingUrl { get ; set ; }
63
118
public int Time { get ; set ; }
64
119
public string Branch { get ; set ; }
120
+ public Repos repoType { get ; set ; }
65
121
66
122
public void Download ( )
67
123
{
@@ -89,6 +145,15 @@ public static CodeRepo GetFastRepo()
89
145
90
146
public interface IGet : IDisposable ;
91
147
148
+ public interface IRepoGet : IGet ;
149
+
150
+ public class ThunderStoreGet : IGet
151
+ {
152
+ public void Dispose ( )
153
+ {
154
+ }
155
+ }
156
+
92
157
public class NugetGet : IGet
93
158
{
94
159
public string NugetURL { get ; set ; }
@@ -132,7 +197,7 @@ public void Dispose()
132
197
}
133
198
}
134
199
135
- public class GithubGet ( string RepoOwner , string RepoName ) : IGet
200
+ public class GithubGet ( string RepoOwner , string RepoName ) : IRepoGet
136
201
{
137
202
public const string Api = "https://api.github.com" ;
138
203
public const string Web = "https://github.com" ;
0 commit comments