From 06e2099012d435a19d75f5e92b86d2669e7ea69f Mon Sep 17 00:00:00 2001 From: hello Date: Sun, 3 Mar 2024 11:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/helloshop/copyight.md | 34 ++++++++++++++++++++++++++++++++++ notes/helloshop/openapi.md | 1 + 2 files changed, 35 insertions(+) create mode 100644 notes/helloshop/copyight.md diff --git a/notes/helloshop/copyight.md b/notes/helloshop/copyight.md new file mode 100644 index 0000000..5c9dfc2 --- /dev/null +++ b/notes/helloshop/copyight.md @@ -0,0 +1,34 @@ +# 在项目中添加文件头注释 + +## 文件头注释 + +文件头注释是一种用于说明文件版权和许可的注释。它通常包括版权声明、许可证信息、作者信息和其他相关信息。文件头注释是一种很好的实践,可以帮助开发人员了解文件的版权和许可信息。 + +## 版权申明规范 + +```csharp +// Copyright (c) HelloShop Corporation. All rights reserved. +// See the license file in the project root for more information. + +namespace HelloShop.AppHost +{ + internal class Class1 + { + } +} +``` + +## 关于 EditorConfig 配置文件 + +为跨不同编辑器和 IDE 处理同一项目的多个开发人员保持一致的编码风格。 + +Visual Studio 2019 及更高版本支持 EditorConfig 文件,可以在 Visual Studio 中使用 EditorConfig 文件来定义和维护代码样式设置。 + +## 版权说明模板 + +``` +file_header_template = Copyright (c) HelloShop Corporation. All rights reserved.\nSee the license file in the project root for more information. +``` + +对于文件名,可以使用 `{fileName}` 作为占位符。 + diff --git a/notes/helloshop/openapi.md b/notes/helloshop/openapi.md index 5c75118..2e96e4a 100644 --- a/notes/helloshop/openapi.md +++ b/notes/helloshop/openapi.md @@ -4,6 +4,7 @@ Swagger 是一个与语言无关的规范,用于描述 REST API。 它使计 Swashbuckle 是一个用于 .NET Core 的开源项目,它是 OpenAPI 工具的集合,用于生成 OpenAPI 规范的文档。 它可以自动生成 API 文档,包括 API 的描述、请求和响应的格式、参数的描述等。 + ## 安装 Swashbuckle.AspNetCore 在 .NET Core 项目中,可以通过 NuGet 安装 Swashbuckle.AspNetCore 包。