From facf24e8068c84c335d6b239fe6797d0bf896331 Mon Sep 17 00:00:00 2001
From: shanj <18996038927@163.com>
Date: Wed, 9 Feb 2022 03:35:44 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Binance.TradeRobot.API.sln | 25 +++++++++
.../Binance.TradeRobot.API.csproj | 8 +++
.../Controllers/WeatherForecastController.cs | 39 ++++++++++++++
Binance.TradeRobot.API/Program.cs | 26 ++++++++++
.../Properties/launchSettings.json | 30 +++++++++++
Binance.TradeRobot.API/Startup.cs | 51 +++++++++++++++++++
Binance.TradeRobot.API/WeatherForecast.cs | 15 ++++++
.../appsettings.Development.json | 9 ++++
Binance.TradeRobot.API/appsettings.json | 10 ++++
9 files changed, 213 insertions(+)
create mode 100644 Binance.TradeRobot.API.sln
create mode 100644 Binance.TradeRobot.API/Binance.TradeRobot.API.csproj
create mode 100644 Binance.TradeRobot.API/Controllers/WeatherForecastController.cs
create mode 100644 Binance.TradeRobot.API/Program.cs
create mode 100644 Binance.TradeRobot.API/Properties/launchSettings.json
create mode 100644 Binance.TradeRobot.API/Startup.cs
create mode 100644 Binance.TradeRobot.API/WeatherForecast.cs
create mode 100644 Binance.TradeRobot.API/appsettings.Development.json
create mode 100644 Binance.TradeRobot.API/appsettings.json
diff --git a/Binance.TradeRobot.API.sln b/Binance.TradeRobot.API.sln
new file mode 100644
index 0000000..849e46b
--- /dev/null
+++ b/Binance.TradeRobot.API.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Binance.TradeRobot.API", "Binance.TradeRobot.API\Binance.TradeRobot.API.csproj", "{D568610C-F70C-406F-AB41-C6E2B89B327F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D568610C-F70C-406F-AB41-C6E2B89B327F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D568610C-F70C-406F-AB41-C6E2B89B327F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D568610C-F70C-406F-AB41-C6E2B89B327F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D568610C-F70C-406F-AB41-C6E2B89B327F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {942D9273-B886-4214-BF53-7C788B5DA648}
+ EndGlobalSection
+EndGlobal
diff --git a/Binance.TradeRobot.API/Binance.TradeRobot.API.csproj b/Binance.TradeRobot.API/Binance.TradeRobot.API.csproj
new file mode 100644
index 0000000..d12c450
--- /dev/null
+++ b/Binance.TradeRobot.API/Binance.TradeRobot.API.csproj
@@ -0,0 +1,8 @@
+
+
+
+ netcoreapp3.1
+
+
+
+
diff --git a/Binance.TradeRobot.API/Controllers/WeatherForecastController.cs b/Binance.TradeRobot.API/Controllers/WeatherForecastController.cs
new file mode 100644
index 0000000..07ac644
--- /dev/null
+++ b/Binance.TradeRobot.API/Controllers/WeatherForecastController.cs
@@ -0,0 +1,39 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Binance.TradeRobot.API.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]
+ public IEnumerable Get()
+ {
+ var rng = new Random();
+ return Enumerable.Range(1, 5).Select(index => new WeatherForecast
+ {
+ Date = DateTime.Now.AddDays(index),
+ TemperatureC = rng.Next(-20, 55),
+ Summary = Summaries[rng.Next(Summaries.Length)]
+ })
+ .ToArray();
+ }
+ }
+}
diff --git a/Binance.TradeRobot.API/Program.cs b/Binance.TradeRobot.API/Program.cs
new file mode 100644
index 0000000..feb5d50
--- /dev/null
+++ b/Binance.TradeRobot.API/Program.cs
@@ -0,0 +1,26 @@
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Binance.TradeRobot.API
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ CreateHostBuilder(args).Build().Run();
+ }
+
+ public static IHostBuilder CreateHostBuilder(string[] args) =>
+ Host.CreateDefaultBuilder(args)
+ .ConfigureWebHostDefaults(webBuilder =>
+ {
+ webBuilder.UseStartup();
+ });
+ }
+}
diff --git a/Binance.TradeRobot.API/Properties/launchSettings.json b/Binance.TradeRobot.API/Properties/launchSettings.json
new file mode 100644
index 0000000..19db158
--- /dev/null
+++ b/Binance.TradeRobot.API/Properties/launchSettings.json
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:63190",
+ "sslPort": 44395
+ }
+ },
+ "profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "weatherforecast",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "Binance.TradeRobot.API": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "launchUrl": "weatherforecast",
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/Binance.TradeRobot.API/Startup.cs b/Binance.TradeRobot.API/Startup.cs
new file mode 100644
index 0000000..7d66225
--- /dev/null
+++ b/Binance.TradeRobot.API/Startup.cs
@@ -0,0 +1,51 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.HttpsPolicy;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Binance.TradeRobot.API
+{
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddControllers();
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+ {
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+
+ app.UseHttpsRedirection();
+
+ app.UseRouting();
+
+ app.UseAuthorization();
+
+ app.UseEndpoints(endpoints =>
+ {
+ endpoints.MapControllers();
+ });
+ }
+ }
+}
diff --git a/Binance.TradeRobot.API/WeatherForecast.cs b/Binance.TradeRobot.API/WeatherForecast.cs
new file mode 100644
index 0000000..5bb17c6
--- /dev/null
+++ b/Binance.TradeRobot.API/WeatherForecast.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace Binance.TradeRobot.API
+{
+ public class WeatherForecast
+ {
+ public DateTime Date { get; set; }
+
+ public int TemperatureC { get; set; }
+
+ public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+
+ public string Summary { get; set; }
+ }
+}
diff --git a/Binance.TradeRobot.API/appsettings.Development.json b/Binance.TradeRobot.API/appsettings.Development.json
new file mode 100644
index 0000000..8983e0f
--- /dev/null
+++ b/Binance.TradeRobot.API/appsettings.Development.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ }
+}
diff --git a/Binance.TradeRobot.API/appsettings.json b/Binance.TradeRobot.API/appsettings.json
new file mode 100644
index 0000000..d9d9a9b
--- /dev/null
+++ b/Binance.TradeRobot.API/appsettings.json
@@ -0,0 +1,10 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ },
+ "AllowedHosts": "*"
+}