Rename steeltoe-webapi projects so as to be unique
This commit is contained in:
Родитель
61e518fd3e
Коммит
3fcd2d2b01
|
@ -221,7 +221,7 @@ using Microsoft.Extensions.Logging;
|
|||
#endif
|
||||
{
|
||||
#if (HelloWorldOption)
|
||||
logger.LogInformation("Hello, World, from {Name}", "Company.WebApplication1");
|
||||
logger.LogInformation("Hello, World, from {Name}", "Company.WebApplication.CS");
|
||||
#endif
|
||||
if (env.IsDevelopment())
|
||||
...
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.6.30114.105
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7A45E423-F8A2-4421-81B6-24E6A9E9A64D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Company.WebApplication1", "src\Content\NetCoreTool.Template.WebApi\CSharp\Company.WebApplication1.csproj", "{D991A16C-69AD-457F-B9FA-EB0531CF7288}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Company.WebApplication.CS", "src\Content\NetCoreTool.Template.WebApi\CSharp\Company.WebApplication.CS.csproj", "{D991A16C-69AD-457F-B9FA-EB0531CF7288}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E6A8112D-A16A-481D-844B-E941C29A6BC4}"
|
||||
EndProject
|
||||
|
@ -26,7 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steeltoe.NetCoreTool.Templates", "src\Steeltoe.NetCoreTool.Templates.csproj", "{8C63F895-1AD7-47F1-8074-7E6832E59D62}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Company.WebApplication1", "src\Content\NetCoreTool.Template.WebApi\FSharp\Company.WebApplication1.fsproj", "{D898629D-C5A8-4AEC-A028-914BF2DB3878}"
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Company.WebApplication.FS", "src\Content\NetCoreTool.Template.WebApi\FSharp\Company.WebApplication.FS.fsproj", "{D898629D-C5A8-4AEC-A028-914BF2DB3878}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Company.WebApplication1.Controllers
|
||||
namespace Company.WebApplication.CS.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
|
|
|
@ -4,16 +4,16 @@ EXPOSE 80
|
|||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY ["Company.WebApplication1.csproj", "."]
|
||||
RUN dotnet restore "Company.WebApplication1.csproj"
|
||||
COPY ["Company.WebApplication.CS.csproj", "."]
|
||||
RUN dotnet restore "Company.WebApplication.CS.csproj"
|
||||
COPY . .
|
||||
RUN dotnet build "Company.WebApplication1.csproj" -c Release -o /app
|
||||
RUN dotnet build "Company.WebApplication.CS.csproj" -c Release -o /app
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Company.WebApplication1.csproj" -c Release -o /app
|
||||
RUN dotnet publish "Company.WebApplication.CS.csproj" -c Release -o /app
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
ENV DOTNET_URLS http://0.0.0.0:80
|
||||
ENTRYPOINT ["dotnet", "Company.WebApplication1.dll"]
|
||||
ENTRYPOINT ["dotnet", "Company.WebApplication.CS.dll"]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using Steeltoe.CircuitBreaker.Hystrix;
|
||||
|
||||
namespace Company.WebApplication1
|
||||
namespace Company.WebApplication.CS
|
||||
{
|
||||
public sealed class HelloHystrixCommand : HystrixCommand<string>
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#if (AnyEfCore)
|
||||
namespace Company.WebApplication1.Models
|
||||
namespace Company.WebApplication.CS.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
|
||||
namespace Company.WebApplication1.Models
|
||||
namespace Company.WebApplication.CS.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class Message
|
||||
|
|
|
@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Company.WebApplication1.Models
|
||||
namespace Company.WebApplication.CS.Models
|
||||
{
|
||||
public class SampleContext : DbContext
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ using Steeltoe.Extensions.Configuration.RandomValue;
|
|||
using Steeltoe.Extensions.Logging;
|
||||
#endif
|
||||
|
||||
namespace Company.WebApplication1
|
||||
namespace Company.WebApplication.CS
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"Company.WebApplication1": {
|
||||
"Company.WebApplication.CS": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
//#if (FrameworkNet50)
|
||||
|
|
|
@ -79,10 +79,10 @@ using Steeltoe.Management.Endpoint;
|
|||
using Steeltoe.Management.Tracing;
|
||||
#endif
|
||||
#if (AnyEfCore)
|
||||
using Company.WebApplication1.Models;
|
||||
using Company.WebApplication.CS.Models;
|
||||
#endif
|
||||
|
||||
namespace Company.WebApplication1
|
||||
namespace Company.WebApplication.CS
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
|
@ -152,7 +152,7 @@ namespace Company.WebApplication1
|
|||
#if (FrameworkNet50)
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Company.WebApplication1", Version = "v1" });
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Company.WebApplication.CS", Version = "v1" });
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ namespace Company.WebApplication1
|
|||
app.UseDeveloperExceptionPage();
|
||||
#if (FrameworkNet50)
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Company.WebApplication1 v1"));
|
||||
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Company.WebApplication.CS"));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
using System;
|
||||
|
||||
namespace Company.WebApplication1
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace Company.WebApplication.CS
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"Steeltoe": "Information",
|
||||
"Company.WebApplication1": "Debug"
|
||||
"Company.WebApplication.CS": "Debug"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"Steeltoe": "Warning",
|
||||
"Company.WebApplication1": "Information"
|
||||
"Company.WebApplication.CS": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
namespace Company.WebApplication1.Controllers
|
||||
|
||||
open System
|
||||
open System.Collections.Generic
|
||||
open System.Linq
|
||||
open System.Threading.Tasks
|
||||
open Microsoft.AspNetCore.Mvc
|
||||
open Microsoft.Extensions.Logging
|
||||
open Company.WebApplication1
|
||||
|
||||
[<ApiController>]
|
||||
[<Route("[controller]")>]
|
||||
type WeatherForecastController (logger : ILogger<WeatherForecastController>) =
|
||||
inherit ControllerBase()
|
||||
|
||||
let summaries =
|
||||
[|
|
||||
"Freezing"
|
||||
"Bracing"
|
||||
"Chilly"
|
||||
"Cool"
|
||||
"Mild"
|
||||
"Warm"
|
||||
"Balmy"
|
||||
"Hot"
|
||||
"Sweltering"
|
||||
"Scorching"
|
||||
|]
|
||||
|
||||
[<HttpGet>]
|
||||
member _.Get() =
|
||||
let rng = System.Random()
|
||||
[|
|
||||
for index in 0..4 ->
|
||||
{ Date = DateTime.Now.AddDays(float index)
|
||||
TemperatureC = rng.Next(-20,55)
|
||||
Summary = summaries.[rng.Next(summaries.Length)] }
|
||||
|]
|
||||
namespace Company.WebApplication.FS.Controllers
|
||||
|
||||
open System
|
||||
open System.Collections.Generic
|
||||
open System.Linq
|
||||
open System.Threading.Tasks
|
||||
open Microsoft.AspNetCore.Mvc
|
||||
open Microsoft.Extensions.Logging
|
||||
open Company.WebApplication.FS
|
||||
|
||||
[<ApiController>]
|
||||
[<Route("[controller]")>]
|
||||
type WeatherForecastController (logger : ILogger<WeatherForecastController>) =
|
||||
inherit ControllerBase()
|
||||
|
||||
let summaries =
|
||||
[|
|
||||
"Freezing"
|
||||
"Bracing"
|
||||
"Chilly"
|
||||
"Cool"
|
||||
"Mild"
|
||||
"Warm"
|
||||
"Balmy"
|
||||
"Hot"
|
||||
"Sweltering"
|
||||
"Scorching"
|
||||
|]
|
||||
|
||||
[<HttpGet>]
|
||||
member _.Get() =
|
||||
let rng = System.Random()
|
||||
[|
|
||||
for index in 0..4 ->
|
||||
{ Date = DateTime.Now.AddDays(float index)
|
||||
TemperatureC = rng.Next(-20,55)
|
||||
Summary = summaries.[rng.Next(summaries.Length)] }
|
||||
|]
|
||||
|
|
|
@ -4,16 +4,16 @@ EXPOSE 80
|
|||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY ["Company.WebApplication1.fsproj", "."]
|
||||
RUN dotnet restore "Company.WebApplication1.fsproj"
|
||||
COPY ["Company.WebApplication.FS.fsproj", "."]
|
||||
RUN dotnet restore "Company.WebApplication.FS.fsproj"
|
||||
COPY . .
|
||||
RUN dotnet build "Company.WebApplication1.fsproj" -c Release -o /app
|
||||
RUN dotnet build "Company.WebApplication.FS.fsproj" -c Release -o /app
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Company.WebApplication1.fsproj" -c Release -o /app
|
||||
RUN dotnet publish "Company.WebApplication.FS.fsproj" -c Release -o /app
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
ENV DOTNET_URLS http://0.0.0.0:80
|
||||
ENTRYPOINT ["dotnet", "Company.WebApplication1.dll"]
|
||||
ENTRYPOINT ["dotnet", "Company.WebApplication.FS.dll"]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Company.WebApplication1
|
||||
namespace Company.WebApplication.FS
|
||||
#if (CircuitBreakerHystrixOption)
|
||||
|
||||
open System.Threading.Tasks
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
namespace Company.WebApplication.FS.Models
|
||||
#if (AnyEfCore)
|
||||
namespace Company.WebApplication1.Models
|
||||
|
||||
type ErrorViewModel
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Company.WebApplication1.Models
|
||||
namespace Company.WebApplication.FS.Models
|
||||
|
||||
#if (AnyEfCore)
|
||||
open Microsoft.EntityFrameworkCore
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Company.WebApplication1
|
||||
namespace Company.WebApplication.FS
|
||||
|
||||
open System
|
||||
open System.Collections.Generic
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"Company.WebApplication1": {
|
||||
"Company.WebApplication.FS": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": "true",
|
||||
"launchBrowser": true,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Company.WebApplication1
|
||||
namespace Company.WebApplication.FS
|
||||
|
||||
open Microsoft.AspNetCore.Builder
|
||||
open Microsoft.AspNetCore.Hosting
|
||||
|
@ -78,7 +78,7 @@ open Steeltoe.Management.Endpoint
|
|||
open Steeltoe.Management.Tracing
|
||||
#endif
|
||||
#if (AnyEfCore)
|
||||
open Company.WebApplication1.Models
|
||||
open Company.WebApplication.FS.Models
|
||||
#endif
|
||||
|
||||
#if (NeedsSelf)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
namespace Company.WebApplication1
|
||||
|
||||
open System
|
||||
|
||||
type WeatherForecast =
|
||||
{ Date: DateTime
|
||||
TemperatureC: int
|
||||
Summary: string }
|
||||
|
||||
member this.TemperatureF =
|
||||
32.0 + (float this.TemperatureC / 0.5556)
|
||||
namespace Company.WebApplication.FS
|
||||
|
||||
open System
|
||||
|
||||
type WeatherForecast =
|
||||
{ Date: DateTime
|
||||
TemperatureC: int
|
||||
Summary: string }
|
||||
|
||||
member this.TemperatureF =
|
||||
32.0 + (float this.TemperatureC / 0.5556)
|
||||
|
|
Загрузка…
Ссылка в новой задаче