Skip to content

Commit 956b1a7

Browse files
committed
整理代码
1 parent e8d66a2 commit 956b1a7

File tree

12 files changed

+11
-52
lines changed

12 files changed

+11
-52
lines changed

CodeTest/Program.cs

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
using ColoryrServer.Core.FileSystem;
2-
using Newtonsoft.Json;
32
using System;
4-
using System.Collections.Generic;
5-
using System.Net;
6-
using System.Net.Http;
73

84
var dir = new StaticDir(AppContext.BaseDirectory + "web/");
95

ColoryrServer/ASP/ASPConfig.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Collections.Generic;
2-
using ColoryrServer.FileSystem;
1+
using ColoryrServer.FileSystem;
32
using Lib.Build;
43

54
namespace ColoryrServer.ASP

ColoryrServer/ASP/ColoryrLogger.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Collections.Concurrent;
3-
using Microsoft.Extensions.Logging;
1+
using System.Collections.Concurrent;
42

53
namespace ColoryrServer.ASP
64
{

ColoryrServer/ASP/HttpClients.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Net.Http;
2-
3-
namespace ColoryrServer.ASP
1+
namespace ColoryrServer.ASP
42
{
53
public interface IHttpClients
64
{

ColoryrServer/ASP/Program.cs

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
1-
using System;
21
using ColoryrServer.DllManager;
32
using ColoryrServer.FileSystem;
43
using ColoryrServer.Http;
54
using ColoryrServer.SDK;
6-
using ColoryrServer.Utils;
75
using HttpMultipartParser;
86
using Lib.App;
97
using Lib.Build;
108
using Lib.Build.Object;
119
using Lib.Server;
1210
using Microsoft.AspNetCore.Connections;
1311
using Microsoft.Extensions.Primitives;
14-
using Newtonsoft.Json;
1512
using Newtonsoft.Json.Linq;
16-
using System.Collections.Concurrent;
17-
using System.Collections.Generic;
1813
using System.Collections.Specialized;
19-
using System.Diagnostics;
20-
using System.IO;
21-
using System.Linq;
22-
using System.Net.Http;
2314
using System.Security.Cryptography.X509Certificates;
2415
using System.Text;
25-
using System.Threading;
26-
using System.Threading.Tasks;
27-
using Microsoft.AspNetCore.Builder;
28-
using Microsoft.AspNetCore.Hosting;
29-
using Microsoft.AspNetCore.Http;
30-
using Microsoft.AspNetCore.Routing;
31-
using Microsoft.Extensions.DependencyInjection;
32-
using Microsoft.Extensions.Logging;
3316
using HttpRequest = Microsoft.AspNetCore.Http.HttpRequest;
3417
using HttpResponse = Microsoft.AspNetCore.Http.HttpResponse;
3518

@@ -495,7 +478,7 @@ private static async Task GetStatic(HttpContext context)
495478
if (a != -1)
496479
{
497480
string type = name[a..];
498-
if(Config.Requset.StreamType.Contains(type))
481+
if (Config.Requset.StreamType.Contains(type))
499482
{
500483
NameValueCollection collection = new();
501484
foreach (var item in Request.Headers)
@@ -521,7 +504,7 @@ private static async Task GetStatic(HttpContext context)
521504
if (stream == null)
522505
{
523506
Response.StatusCode = 500;
524-
await Response.WriteAsync("stream in null",Encoding.UTF8);
507+
await Response.WriteAsync("stream in null", Encoding.UTF8);
525508
}
526509
else
527510
{

ColoryrServer/Core/DllManager/DllBuild.cs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using ColoryrServer.DllManager.StartGen.GenUtils;
44
using ColoryrServer.FileSystem;
55
using ColoryrServer.Http;
6-
using ColoryrServer.Utils;
76
using Lib.Build;
87
using Lib.Build.Object;
98
using Newtonsoft.Json;

ColoryrServer/Core/DllManager/DllRun.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System;
77
using System.Collections.Generic;
88
using System.Reflection;
9-
using System.Threading.Tasks;
109

1110
namespace ColoryrServer.DllManager
1211
{
@@ -81,7 +80,7 @@ public static HttpReturn DllGo(DllBuildSave dll, HttpRequest arg, string functio
8180
return new HttpReturn
8281
{
8382
Data = dr.Data,
84-
Res = ResType.Stream,
83+
Res = ResType.Stream,
8584
Head = dr.Head,
8685
ContentType = dr.ContentType,
8786
ReCode = dr.ReCode,

ColoryrServer/Core/FileSystem/HtmlFileObj.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace ColoryrServer.Core.FileSystem
1+
namespace ColoryrServer.Core.FileSystem
82
{
93
public class HtmlFileObj
104
{

ColoryrServer/Core/FileSystem/StaticDir.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
using ColoryrServer.FileSystem;
22
using System;
33
using System.Collections.Concurrent;
4-
using System.Collections.Generic;
54
using System.IO;
6-
using System.Linq;
7-
using System.Text;
85
using System.Threading;
9-
using System.Threading.Tasks;
106

117
namespace ColoryrServer.Core.FileSystem
128
{
@@ -84,7 +80,7 @@ public void OnRnamed(object sender, RenamedEventArgs e)
8480
Console.WriteLine($"rename file:{e.FullPath}");
8581
}
8682
}
87-
else if(NextDir.ContainsKey(e.OldName))
83+
else if (NextDir.ContainsKey(e.OldName))
8884
{
8985
if (NextDir.TryRemove(e.OldName, out var v1))
9086
{
@@ -113,7 +109,7 @@ public void OnDeleted(object sender, FileSystemEventArgs e)
113109

114110
public void OnCreated(object sender, FileSystemEventArgs e)
115111
{
116-
if(Directory.Exists(e.FullPath))
112+
if (Directory.Exists(e.FullPath))
117113
{
118114
var dir = new StaticDir(e.FullPath);
119115
NextDir.TryAdd(e.Name, dir);

ColoryrServer/Core/Http/HttpReturn.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
using ColoryrServer.SDK;
22
using System.Collections.Generic;
3-
using System.IO;
43
using System.Text;
54

65
namespace ColoryrServer.Http
76
{
87
public enum ResType
9-
{
10-
Json,String,Byte,Stream
8+
{
9+
Json, String, Byte, Stream
1110
}
1211
public record HttpReturn
1312
{

ColoryrServer/Core/IoT/SocketServer.cs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Net;
44
using System.Net.Sockets;
55
using System.Threading;
6-
using System.Threading.Tasks;
76

87
namespace ColoryrServer.Socket
98
{

ColoryrServer/Core/WebSocket/ServerWebSocket.cs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Collections.Generic;
66
using System.Linq;
77
using System.Threading;
8-
using System.Threading.Tasks;
98

109
namespace ColoryrServer.WebSocket
1110
{

0 commit comments

Comments
 (0)