sync code

This commit is contained in:
2023-06-26 22:33:44 +08:00
parent 2d87e50dd0
commit 4bf330f824
26 changed files with 2644 additions and 62 deletions

View File

@@ -6,7 +6,7 @@ using System.Text;
namespace Blahblah.FlowerStory.Server.Controller;
/// <inheritdoc/>
[Route("apidoc")]
[Route("")]
public class SwaggerController : ControllerBase
{
private readonly SwaggerGenerator generator;
@@ -18,7 +18,38 @@ public class SwaggerController : ControllerBase
}
/// <inheritdoc/>
[Route("get/{version}")]
[Route("")]
[Produces("text/html")]
[HttpGet]
public ActionResult Get()
{
return Content($@"<!DOCTYPE html>
<html>
<head>
<title>Redoc</title>
<!-- needed for adaptive design -->
<meta charset=""utf-8""/>
<meta name=""viewport"" content=""width=device-width, initial-scale=1"">
<!--
Redoc doesn't change outer page styles
-->
<style>
body {{
margin: 0;
padding: 0;
}}
</style>
</head>
<body>
<redoc spec-url=""/swagger/{Program.Version}/swagger.json""></redoc>
<script src=""/js/redoc.standalone.js""> </script>
</body>
</html>", "text/html");
}
/// <inheritdoc/>
[Route("apidoc/{version}")]
[Produces("text/html")]
[HttpGet]
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]