Commit ff998fb4 authored by shRabbit's avatar shRabbit
Browse files

移除不必要的内容。

parent 4c23e459
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
using Microsoft.AspNetCore.Mvc;

namespace OpsBot.Controllers;

[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
    private static readonly string[] Summaries =
    [
        "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
    ];

    [HttpGet(Name = "GetWeatherForecast")]
    public IEnumerable<WeatherForecast> 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();
    }
}
 No newline at end of file
+0 −4
Original line number Diff line number Diff line
@@ -7,10 +7,6 @@
        <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.3"/>
    </ItemGroup>

    <ItemGroup>
      <Content Include="..\..\.dockerignore">
        <Link>.dockerignore</Link>

src/OpsBot/OpsBot.http

deleted100644 → 0
+0 −6
Original line number Diff line number Diff line
@OpsBot_HostAddress = http://localhost:5073

GET {{OpsBot_HostAddress}}/weatherforecast/
Accept: application/json

###
+0 −19
Original line number Diff line number Diff line
@@ -6,27 +6,8 @@ public class Program
    {
        var builder = WebApplication.CreateBuilder(args);

        // Add services to the container.

        builder.Services.AddControllers();
        // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
        builder.Services.AddOpenApi();

        var app = builder.Build();

        // Configure the HTTP request pipeline.
        if (app.Environment.IsDevelopment())
        {
            app.MapOpenApi();
        }

        app.UseHttpsRedirection();

        app.UseAuthorization();


        app.MapControllers();

        app.Run();
    }
}
 No newline at end of file

src/OpsBot/WeatherForecast.cs

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
namespace OpsBot;

public class WeatherForecast
{
    public DateOnly 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