Commit 8701cdde by 据说甜蜜呢

添加新的微服务Searching

parent e85484c0
Pipeline #4381 passed with stage
in 24 seconds
......@@ -54,6 +54,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvcExtensions", "src\BuildingBlocks\Extensions\MvcExtensions\MvcExtensions.csproj", "{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Searching", "Searching", "{2176B42B-AC54-48BE-82F7-104ADEEF2FEF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Searching.Api", "src\Services\Searching\Searching.Api\Searching.Api.csproj", "{47530BB8-0971-4D51-9EAA-9F74DFF8458D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -92,6 +96,10 @@ Global
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}.Release|Any CPU.Build.0 = Release|Any CPU
{47530BB8-0971-4D51-9EAA-9F74DFF8458D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47530BB8-0971-4D51-9EAA-9F74DFF8458D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47530BB8-0971-4D51-9EAA-9F74DFF8458D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47530BB8-0971-4D51-9EAA-9F74DFF8458D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -115,6 +123,8 @@ Global
{E53A0586-2FB1-4708-91A9-4D6814E02E3C} = {779A24FC-0621-4085-AB80-9BD0BB6AF605}
{26EA0840-FACE-4F72-B7D0-64CA9443BD9F} = {E53A0586-2FB1-4708-91A9-4D6814E02E3C}
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193} = {26EA0840-FACE-4F72-B7D0-64CA9443BD9F}
{2176B42B-AC54-48BE-82F7-104ADEEF2FEF} = {5267E5D9-2B87-4B75-92FD-111624A81E7D}
{47530BB8-0971-4D51-9EAA-9F74DFF8458D} = {2176B42B-AC54-48BE-82F7-104ADEEF2FEF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94A499F2-8AA4-43FC-9824-F095E42D54AB}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Searching.Api.Controllers
{
[Route("[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
// GET api/values
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
return "value";
}
// POST api/values
[HttpPost]
public void Post([FromBody] string value)
{
}
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] string value)
{
}
// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
}
FROM microsoft/dotnet:2.2.0-aspnetcore-runtime
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
MAINTAINER geekbuy.cn
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "Searching.Api.dll"]
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace Searching.Api
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:55470",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Searching.Api": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/values",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\BuildingBlocks\Extensions\MvcExtensions\MvcExtensions.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MvcExtensions;
namespace Searching.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.AddMvc(it => it.UseCentralRoutePrefix("/api/searching")).SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*"
}
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*"
}
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment