35 changed files with 120 additions and 285 deletions
@ -1,11 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3"/> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -1,40 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace CompanyName.ProjectName.PublicGateway.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<WeatherForecastController> _logger; |
|||
|
|||
public WeatherForecastController(ILogger<WeatherForecastController> logger) |
|||
{ |
|||
_logger = logger; |
|||
} |
|||
|
|||
[HttpGet] |
|||
public IEnumerable<WeatherForecast> 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(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace CompanyName.ProjectName.PublicGateway |
|||
{ |
|||
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<Startup>(); }); |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
{ |
|||
"$schema": "http://json.schemastore.org/launchsettings.json", |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "http://localhost:29877", |
|||
"sslPort": 44344 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"launchUrl": "swagger", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"CompanyName.ProjectName.PublicGateway": { |
|||
"commandName": "Project", |
|||
"dotnetRunMessages": "true", |
|||
"launchBrowser": true, |
|||
"launchUrl": "swagger", |
|||
"applicationUrl": "https://localhost:5001;http://localhost:5000", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,58 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
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 Microsoft.OpenApi.Models; |
|||
|
|||
namespace CompanyName.ProjectName.PublicGateway |
|||
{ |
|||
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(); |
|||
services.AddSwaggerGen(c => |
|||
{ |
|||
c.SwaggerDoc("v1", |
|||
new OpenApiInfo |
|||
{ Title = "CompanyName.ProjectName.PublicGateway", Version = "v1" }); |
|||
}); |
|||
} |
|||
|
|||
// 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.UseSwagger(); |
|||
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", |
|||
"CompanyName.ProjectName.PublicGateway v1")); |
|||
} |
|||
|
|||
app.UseHttpsRedirection(); |
|||
|
|||
app.UseRouting(); |
|||
|
|||
app.UseAuthorization(); |
|||
|
|||
app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); |
|||
} |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
using System; |
|||
|
|||
namespace CompanyName.ProjectName.PublicGateway |
|||
{ |
|||
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; } |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
{ |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Information", |
|||
"Microsoft": "Warning", |
|||
"Microsoft.Hosting.Lifetime": "Information" |
|||
} |
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
{ |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Information", |
|||
"Microsoft": "Warning", |
|||
"Microsoft.Hosting.Lifetime": "Information" |
|||
} |
|||
}, |
|||
"AllowedHosts": "*" |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
{ |
|||
"Serilog": { |
|||
"MinimumLevel": { |
|||
"Default": "Information", |
|||
"Override": { |
|||
"Microsoft": "Information", |
|||
"Volo.Abp": "Information", |
|||
"Hangfire": "Information", |
|||
"DotNetCore.CAP": "Information", |
|||
"Serilog.AspNetCore": "Information" |
|||
} |
|||
} |
|||
}, |
|||
"App": { |
|||
"SelfUrl": "http://localhost:44315", |
|||
"CorsOrigins": "https://*.ProjectName.com,http://localhost:4200,http://localhost:3100" |
|||
}, |
|||
"ConnectionStrings": { |
|||
"Default": "Data Source=localhost;Database=CompanyNameProjectNameDB20211106;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" |
|||
}, |
|||
"Redis": { |
|||
"Configuration": "localhost,password=mypassword,defaultdatabase=1" |
|||
}, |
|||
"Jwt": { |
|||
"Audience": "CompanyNameProjectName", |
|||
//客户端标识 |
|||
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", |
|||
"Issuer": "CompanyNameProjectName", |
|||
//签发者 |
|||
"ExpirationTime": 24 |
|||
//过期时间 hour |
|||
}, |
|||
"Cap": { |
|||
"Enabled": "false", |
|||
"RabbitMq": { |
|||
"HostName": "localhost", |
|||
"UserName": "admin", |
|||
"Password": "admin" |
|||
} |
|||
}, |
|||
"LogToElasticSearch": { |
|||
"Enabled": "false", |
|||
"ElasticSearch": { |
|||
"Url": "http://es.cn", |
|||
"IndexFormat": "companyname.projectname.development", |
|||
"UserName": "elastic", |
|||
"Password": "aVVhjQ95RP7nbwNy", |
|||
"DashboardIndex": "companyname.projectname" |
|||
} |
|||
}, |
|||
"HttpClient": { |
|||
"Sts": { |
|||
"Url": "http://localhost:44354" |
|||
} |
|||
}, |
|||
"Consul": { |
|||
"Enabled": true, |
|||
"Host": "http://localhost:8500", |
|||
"Service": "Project-Service" |
|||
} |
|||
} |
|||
@ -1,2 +0,0 @@ |
|||
{ |
|||
} |
|||
@ -1,2 +0,0 @@ |
|||
{ |
|||
} |
|||
@ -1,13 +1,11 @@ |
|||
{ |
|||
|
|||
"profiles": { |
|||
|
|||
"CompanyName.ProjectName.IdentityServer": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"launchBrowser": false, |
|||
"applicationUrl": "http://localhost:44354", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Production" |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,17 +0,0 @@ |
|||
{ |
|||
"App": { |
|||
"SelfUrl": "https://localhost:44354", |
|||
"ClientUrl": "http://localhost:4200", |
|||
"CorsOrigins": "https://*.ProjectName.com,http://localhost:4200,https://localhost:44307,https://localhost:44315", |
|||
"RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" |
|||
}, |
|||
"ConnectionStrings": { |
|||
"Default": "Data Source=localhost;Database=CompanyNameProjectNameDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" |
|||
}, |
|||
"Redis": { |
|||
"Configuration": "localhost,password=mypassword" |
|||
}, |
|||
"StringEncryption": { |
|||
"DefaultPassPhrase": "YFLtqf75HkDnKR0n" |
|||
} |
|||
} |
|||
@ -1,2 +0,0 @@ |
|||
{ |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
// using System.Threading.Tasks;
|
|||
// using Microsoft.AspNetCore.Mvc;
|
|||
// using Volo.Abp.Application.Services;
|
|||
// using Volo.Abp.AspNetCore.Mvc;
|
|||
// using Volo.Abp.AspNetCore.Mvc.AntiForgery;
|
|||
// using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
|
|||
// using Volo.Abp.DependencyInjection;
|
|||
//
|
|||
// namespace CompanyName.ProjectName.WebGateway.Controllers
|
|||
// {
|
|||
// [Dependency(ReplaceServices = true)]
|
|||
// [ExposeServices(typeof(IAbpApplicationConfigurationAppService))]
|
|||
// [Route("ProjectName")]
|
|||
// public class ProjectNameAbpApplicationConfigurationController : AbpController,IAbpApplicationConfigurationAppService
|
|||
// {
|
|||
// private readonly IAbpApplicationConfigurationAppService _applicationConfigurationAppService;
|
|||
// private readonly IAbpAntiForgeryManager _antiForgeryManager;
|
|||
//
|
|||
// public ProjectNameAbpApplicationConfigurationController(
|
|||
// IAbpApplicationConfigurationAppService applicationConfigurationAppService,
|
|||
// IAbpAntiForgeryManager antiForgeryManager)
|
|||
// {
|
|||
// _applicationConfigurationAppService = applicationConfigurationAppService;
|
|||
// _antiForgeryManager = antiForgeryManager;
|
|||
// }
|
|||
//
|
|||
// [HttpGet("api/abp/application-configuration")]
|
|||
// public async Task<ApplicationConfigurationDto> GetAsync()
|
|||
// {
|
|||
// _antiForgeryManager.SetCookie();
|
|||
// return await _applicationConfigurationAppService.GetAsync();
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
Loading…
Reference in new issue