diff --git a/QRBee.sln b/QRBee.sln index 8801a9c..f6e179e 100644 --- a/QRBee.sln +++ b/QRBee.sln @@ -7,7 +7,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRBee.Android", "QRBee\QRBe EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRBee.iOS", "QRBee\QRBee.iOS\QRBee.iOS.csproj", "{D46DBAB1-19E0-441C-B2DB-38F1620C160E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRBee", "QRBee\QRBee\QRBee.csproj", "{9C717836-BE20-4721-877B-8B6250245FF9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QRBee", "QRBee\QRBee\QRBee.csproj", "{9C717836-BE20-4721-877B-8B6250245FF9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRBeeApi", "QRBeeApi\QRBeeApi.csproj", "{D985A736-12A3-4A7A-B1A7-502321BD460A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -73,6 +75,18 @@ Global {9C717836-BE20-4721-877B-8B6250245FF9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {9C717836-BE20-4721-877B-8B6250245FF9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {9C717836-BE20-4721-877B-8B6250245FF9}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Debug|iPhone.Build.0 = Debug|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Release|Any CPU.Build.0 = Release|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Release|iPhone.ActiveCfg = Release|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Release|iPhone.Build.0 = Release|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D985A736-12A3-4A7A-B1A7-502321BD460A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/QRBeeApi/Controllers/WeatherForecastController.cs b/QRBeeApi/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..7ce984e --- /dev/null +++ b/QRBeeApi/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace QRBeeApi.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 = DateTime.Now.AddDays(index), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} \ No newline at end of file diff --git a/QRBeeApi/Program.cs b/QRBeeApi/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/QRBeeApi/Program.cs @@ -0,0 +1,25 @@ +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.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/QRBeeApi/Properties/launchSettings.json b/QRBeeApi/Properties/launchSettings.json new file mode 100644 index 0000000..1203f3f --- /dev/null +++ b/QRBeeApi/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:1103", + "sslPort": 44300 + } + }, + "profiles": { + "QRBeeApi": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7000;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/QRBeeApi/QRBeeApi.csproj b/QRBeeApi/QRBeeApi.csproj new file mode 100644 index 0000000..60bf9ea --- /dev/null +++ b/QRBeeApi/QRBeeApi.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/QRBeeApi/WeatherForecast.cs b/QRBeeApi/WeatherForecast.cs new file mode 100644 index 0000000..a818081 --- /dev/null +++ b/QRBeeApi/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace QRBeeApi +{ + 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; } + } +} \ No newline at end of file diff --git a/QRBeeApi/appsettings.Development.json b/QRBeeApi/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/QRBeeApi/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/QRBeeApi/appsettings.json b/QRBeeApi/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/QRBeeApi/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}