From b76f7b61c33602482c11ae9ca72b658160b970ef Mon Sep 17 00:00:00 2001 From: zerlei <1445089819@qq.com> Date: Fri, 21 Jun 2024 12:32:55 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=93?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 13 +++ README.md | 0 Server/FileSqlServerSync.sln | 31 ++++++++ .../Controllers/WeatherForecastController.cs | 33 ++++++++ Server/LocalServer/LocalServer.csproj | 13 +++ Server/LocalServer/Program.cs | 34 ++++++++ .../Properties/launchSettings.json | 31 ++++++++ Server/LocalServer/WeatherForecast.cs | 13 +++ .../LocalServer/appsettings.Development.json | 8 ++ Server/LocalServer/appsettings.json | 9 +++ .../Controllers/WeatherForecastController.cs | 33 ++++++++ Server/RemoteServer/Program.cs | 23 ++++++ .../Properties/launchSettings.json | 31 ++++++++ Server/RemoteServer/RemoteServer.csproj | 13 +++ Server/RemoteServer/WeatherForecast.cs | 13 +++ .../RemoteServer/appsettings.Development.json | 8 ++ Server/RemoteServer/appsettings.json | 9 +++ WebTool/webtool/.vscode/extensions.json | 3 + WebTool/webtool/README.md | 7 ++ WebTool/webtool/index.html | 13 +++ WebTool/webtool/package.json | 18 +++++ WebTool/webtool/public/vite.svg | 1 + WebTool/webtool/src/App.vue | 30 +++++++ WebTool/webtool/src/assets/vue.svg | 1 + WebTool/webtool/src/components/HelloWorld.vue | 40 ++++++++++ WebTool/webtool/src/main.js | 5 ++ WebTool/webtool/src/style.css | 79 +++++++++++++++++++ WebTool/webtool/vite.config.js | 7 ++ 28 files changed, 519 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 Server/FileSqlServerSync.sln create mode 100644 Server/LocalServer/Controllers/WeatherForecastController.cs create mode 100644 Server/LocalServer/LocalServer.csproj create mode 100644 Server/LocalServer/Program.cs create mode 100644 Server/LocalServer/Properties/launchSettings.json create mode 100644 Server/LocalServer/WeatherForecast.cs create mode 100644 Server/LocalServer/appsettings.Development.json create mode 100644 Server/LocalServer/appsettings.json create mode 100644 Server/RemoteServer/Controllers/WeatherForecastController.cs create mode 100644 Server/RemoteServer/Program.cs create mode 100644 Server/RemoteServer/Properties/launchSettings.json create mode 100644 Server/RemoteServer/RemoteServer.csproj create mode 100644 Server/RemoteServer/WeatherForecast.cs create mode 100644 Server/RemoteServer/appsettings.Development.json create mode 100644 Server/RemoteServer/appsettings.json create mode 100644 WebTool/webtool/.vscode/extensions.json create mode 100644 WebTool/webtool/README.md create mode 100644 WebTool/webtool/index.html create mode 100644 WebTool/webtool/package.json create mode 100644 WebTool/webtool/public/vite.svg create mode 100644 WebTool/webtool/src/App.vue create mode 100644 WebTool/webtool/src/assets/vue.svg create mode 100644 WebTool/webtool/src/components/HelloWorld.vue create mode 100644 WebTool/webtool/src/main.js create mode 100644 WebTool/webtool/src/style.css create mode 100644 WebTool/webtool/vite.config.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2cfe279 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +node_modules + +bun.lockb + +bin + +obj + +/bin/ + +/obj/ + +.vs \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/Server/FileSqlServerSync.sln b/Server/FileSqlServerSync.sln new file mode 100644 index 0000000..a09585e --- /dev/null +++ b/Server/FileSqlServerSync.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35013.160 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RemoteServer", "RemoteServer\RemoteServer.csproj", "{42EA16D0-00F2-444F-85B2-23E0C990261C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalServer", "LocalServer\LocalServer.csproj", "{AA0177A1-7CA3-44EA-9BCB-7E0731CE232B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {42EA16D0-00F2-444F-85B2-23E0C990261C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42EA16D0-00F2-444F-85B2-23E0C990261C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42EA16D0-00F2-444F-85B2-23E0C990261C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42EA16D0-00F2-444F-85B2-23E0C990261C}.Release|Any CPU.Build.0 = Release|Any CPU + {AA0177A1-7CA3-44EA-9BCB-7E0731CE232B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA0177A1-7CA3-44EA-9BCB-7E0731CE232B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA0177A1-7CA3-44EA-9BCB-7E0731CE232B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA0177A1-7CA3-44EA-9BCB-7E0731CE232B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {89730DEE-3526-4FCE-9FED-9E5E0AE2FD6D} + EndGlobalSection +EndGlobal diff --git a/Server/LocalServer/Controllers/WeatherForecastController.cs b/Server/LocalServer/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..f1d4199 --- /dev/null +++ b/Server/LocalServer/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LocalServer.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/Server/LocalServer/LocalServer.csproj b/Server/LocalServer/LocalServer.csproj new file mode 100644 index 0000000..9daa180 --- /dev/null +++ b/Server/LocalServer/LocalServer.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/Server/LocalServer/Program.cs b/Server/LocalServer/Program.cs new file mode 100644 index 0000000..c620a67 --- /dev/null +++ b/Server/LocalServer/Program.cs @@ -0,0 +1,34 @@ + +namespace LocalServer +{ + public class Program + { + public static void Main(string[] args) + { + var builder = WebApplication.CreateBuilder(args); + + // Add services to the container. + + builder.Services.AddControllers(); + // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle + builder.Services.AddEndpointsApiExplorer(); + builder.Services.AddSwaggerGen(); + + var app = builder.Build(); + + // Configure the HTTP request pipeline. + if (app.Environment.IsDevelopment()) + { + app.UseSwagger(); + app.UseSwaggerUI(); + } + + app.UseAuthorization(); + + + app.MapControllers(); + + app.Run(); + } + } +} diff --git a/Server/LocalServer/Properties/launchSettings.json b/Server/LocalServer/Properties/launchSettings.json new file mode 100644 index 0000000..8b5cb2f --- /dev/null +++ b/Server/LocalServer/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:34993", + "sslPort": 0 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5014", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Server/LocalServer/WeatherForecast.cs b/Server/LocalServer/WeatherForecast.cs new file mode 100644 index 0000000..a7b4de4 --- /dev/null +++ b/Server/LocalServer/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace LocalServer +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/Server/LocalServer/appsettings.Development.json b/Server/LocalServer/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/Server/LocalServer/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Server/LocalServer/appsettings.json b/Server/LocalServer/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/Server/LocalServer/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/Server/RemoteServer/Controllers/WeatherForecastController.cs b/Server/RemoteServer/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..b016946 --- /dev/null +++ b/Server/RemoteServer/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace FileSqlServerSync.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/Server/RemoteServer/Program.cs b/Server/RemoteServer/Program.cs new file mode 100644 index 0000000..e0269d7 --- /dev/null +++ b/Server/RemoteServer/Program.cs @@ -0,0 +1,23 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); + +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/Server/RemoteServer/Properties/launchSettings.json b/Server/RemoteServer/Properties/launchSettings.json new file mode 100644 index 0000000..5b4e296 --- /dev/null +++ b/Server/RemoteServer/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:24655", + "sslPort": 0 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5165", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Server/RemoteServer/RemoteServer.csproj b/Server/RemoteServer/RemoteServer.csproj new file mode 100644 index 0000000..9daa180 --- /dev/null +++ b/Server/RemoteServer/RemoteServer.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/Server/RemoteServer/WeatherForecast.cs b/Server/RemoteServer/WeatherForecast.cs new file mode 100644 index 0000000..3ab6ac9 --- /dev/null +++ b/Server/RemoteServer/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace FileSqlServerSync +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/Server/RemoteServer/appsettings.Development.json b/Server/RemoteServer/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/Server/RemoteServer/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Server/RemoteServer/appsettings.json b/Server/RemoteServer/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/Server/RemoteServer/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/WebTool/webtool/.vscode/extensions.json b/WebTool/webtool/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/WebTool/webtool/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/WebTool/webtool/README.md b/WebTool/webtool/README.md new file mode 100644 index 0000000..e0acb37 --- /dev/null +++ b/WebTool/webtool/README.md @@ -0,0 +1,7 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` + + diff --git a/WebTool/webtool/package.json b/WebTool/webtool/package.json new file mode 100644 index 0000000..84f4a3f --- /dev/null +++ b/WebTool/webtool/package.json @@ -0,0 +1,18 @@ +{ + "name": "webtool", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "vue": "^3.4.21" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.0.4", + "vite": "^5.2.0" + } +} diff --git a/WebTool/webtool/public/vite.svg b/WebTool/webtool/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/WebTool/webtool/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/WebTool/webtool/src/App.vue b/WebTool/webtool/src/App.vue new file mode 100644 index 0000000..341dbf0 --- /dev/null +++ b/WebTool/webtool/src/App.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/WebTool/webtool/src/assets/vue.svg b/WebTool/webtool/src/assets/vue.svg new file mode 100644 index 0000000..770e9d3 --- /dev/null +++ b/WebTool/webtool/src/assets/vue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/WebTool/webtool/src/components/HelloWorld.vue b/WebTool/webtool/src/components/HelloWorld.vue new file mode 100644 index 0000000..f5e4f53 --- /dev/null +++ b/WebTool/webtool/src/components/HelloWorld.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/WebTool/webtool/src/main.js b/WebTool/webtool/src/main.js new file mode 100644 index 0000000..2425c0f --- /dev/null +++ b/WebTool/webtool/src/main.js @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import './style.css' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/WebTool/webtool/src/style.css b/WebTool/webtool/src/style.css new file mode 100644 index 0000000..bb131d6 --- /dev/null +++ b/WebTool/webtool/src/style.css @@ -0,0 +1,79 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +.card { + padding: 2em; +} + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/WebTool/webtool/vite.config.js b/WebTool/webtool/vite.config.js new file mode 100644 index 0000000..05c1740 --- /dev/null +++ b/WebTool/webtool/vite.config.js @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], +})