diff --git a/Marking.OCR.Service.sln b/Marking.OCR.Service.sln new file mode 100644 index 0000000..1bf6c54 --- /dev/null +++ b/Marking.OCR.Service.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Marking.OCR.Service", "Marking.OCR.Service\Marking.OCR.Service.csproj", "{92728B0C-4ADD-418F-83C2-A77BC6878C74}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {92728B0C-4ADD-418F-83C2-A77BC6878C74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92728B0C-4ADD-418F-83C2-A77BC6878C74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92728B0C-4ADD-418F-83C2-A77BC6878C74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92728B0C-4ADD-418F-83C2-A77BC6878C74}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9E3C110A-D836-4B36-AFE3-77AAF6BC55DB} + EndGlobalSection +EndGlobal diff --git a/Marking.OCR.Service/Controllers/WeatherForecastController.cs b/Marking.OCR.Service/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..f4210b8 --- /dev/null +++ b/Marking.OCR.Service/Controllers/WeatherForecastController.cs @@ -0,0 +1,40 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Marking.OCR.Service.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(); + } + } + + public class WeatherForecast + { + public DateOnly Date { get; set; } + public int TemperatureC { get; set; } + public string Summary { get; set; } + } +} diff --git a/Marking.OCR.Service/Marking.OCR.Service.csproj b/Marking.OCR.Service/Marking.OCR.Service.csproj new file mode 100644 index 0000000..9daa180 --- /dev/null +++ b/Marking.OCR.Service/Marking.OCR.Service.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/Marking.OCR.Service/Program.cs b/Marking.OCR.Service/Program.cs new file mode 100644 index 0000000..146c658 --- /dev/null +++ b/Marking.OCR.Service/Program.cs @@ -0,0 +1,22 @@ +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.MapControllers(); + +app.Run(); \ No newline at end of file diff --git a/Marking.OCR.Service/Properties/launchSettings.json b/Marking.OCR.Service/Properties/launchSettings.json new file mode 100644 index 0000000..d8f6641 --- /dev/null +++ b/Marking.OCR.Service/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:41620", + "sslPort": 0 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5182", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Marking.OCR.Service/appsettings.Development.json b/Marking.OCR.Service/appsettings.Development.json new file mode 100644 index 0000000..b6b6933 --- /dev/null +++ b/Marking.OCR.Service/appsettings.Development.json @@ -0,0 +1,5 @@ +{ + "AgileConfig": { + "Env": "DEV" + } +} diff --git a/Marking.OCR.Service/appsettings.json b/Marking.OCR.Service/appsettings.json new file mode 100644 index 0000000..d7435f9 --- /dev/null +++ b/Marking.OCR.Service/appsettings.json @@ -0,0 +1,10 @@ +{ + // 添加配置请移步 https://config.23544.com/ + "AgileConfig": { + "AppId": "mk-ad", + "Secret": "mkad*()", + "ServerNodes": "http://config.23544.com:15000/,http://config.23544.com:15001/", //多个节点使用逗号分隔, + "Tag": "marking", + "Name": "阅卷后台管理" + } +}