From b916951a5be1f6a056e286d26f38967f343759e0 Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Thu, 23 Oct 2025 02:07:30 +0000 Subject: [PATCH] Add README.md --- README.en.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 README.en.md create mode 100644 README.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..8e77359 --- /dev/null +++ b/README.en.md @@ -0,0 +1,63 @@ +# JenkinsTest Project Documentation + +## Project Overview +JenkinsTest is a .NET-based application project designed to demonstrate how to build a complete application that includes a Web API, database migrations, and dependency injection. The project supports automated testing and deployment through Jenkins, making it suitable for continuous integration and continuous delivery (CI/CD) workflows. + +The main modules of the project include: +- **JenkinsTest.Application**: The application's business logic layer, containing service classes and DTO mappings. +- **JenkinsTest.Core**: The core library, potentially containing shared logic or models. +- **JenkinsTest.EntityFramework.Core**: Database context and Entity Framework-related code. +- **JenkinsTest.Web.Core**: Web API controllers and startup configurations. +- **JenkinsTest.Database.Migrations**: Database migration scripts. +- **JenkinsTest.Web.Entry**: The application entry point, containing main program configuration. + +## Key Features +- Provides system information query interfaces, such as retrieving server IP, system time, and server configuration. +- Supports JWT-based authentication. +- Uses Entity Framework Core for database operations. +- Supports single-file publishing mode for easier deployment. + +## Installation and Running + +### Development Environment Requirements +- .NET SDK 6.0 or later +- SQLite database (default configuration) +- Visual Studio 2022 or later (optional) + +### Building and Running +1. Clone the project: + ```bash + git clone https://gitee.com/Drayce/jenkins-test.git + cd jenkins-test + ``` +2. Restore dependencies: + ```bash + dotnet restore + ``` +3. Build the project: + ```bash + dotnet build + ``` +4. Run the project: + ```bash + dotnet run --project JenkinsTest/JenkinsTest.Web.Entry/JenkinsTest.Web.Entry.csproj + ``` + +### Database Migrations +To update the database schema, run the following command: +```bash +dotnet ef database update --project JenkinsTest/JenkinsTest.Database.Migrations/JenkinsTest.Database.Migrations.csproj +``` + +## Usage Instructions +After starting the project, you can access the following API endpoints: +- `GET /api/system/description`: Retrieve system description information. +- `GET /api/system/date`: Retrieve the current system time. +- `GET /api/system/ip`: Retrieve the server IP address. +- `GET /api/system/config`: Retrieve server configuration information (asynchronous). + +## Contribution Guidelines +Pull requests are welcome. Please ensure you follow the project's coding conventions and perform thorough testing before submitting. + +## License +This project is licensed under the MIT License. Please refer to the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3b33509 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# JenkinsTest 项目说明 + +## 项目简介 +JenkinsTest 是一个基于 .NET 的应用程序项目,旨在演示如何构建一个包含 Web API、数据库迁移以及依赖注入的完整应用程序。该项目支持通过 Jenkins 进行自动化测试和部署,适合用于持续集成和持续交付(CI/CD)流程。 + +项目主要模块包括: +- **JenkinsTest.Application**:应用程序业务逻辑层,包含服务类和 DTO 映射。 +- **JenkinsTest.Core**:核心库,可能包含共享逻辑或模型。 +- **JenkinsTest.EntityFramework.Core**:数据库上下文和实体框架相关代码。 +- **JenkinsTest.Web.Core**:Web API 控制器和启动配置。 +- **JenkinsTest.Database.Migrations**:数据库迁移脚本。 +- **JenkinsTest.Web.Entry**:应用程序入口点,包含主程序配置。 + +## 主要功能 +- 提供系统信息查询接口,如获取服务器 IP、系统时间、服务器配置等。 +- 支持通过 JWT 进行身份验证。 +- 使用 Entity Framework Core 进行数据库操作。 +- 支持单文件发布模式,便于部署。 + +## 安装与运行 +### 开发环境要求 +- .NET SDK 6.0 或更高版本 +- SQLite 数据库(默认配置) +- Visual Studio 2022 或更高版本(可选) + +### 构建与运行 +1. 克隆项目: + ```bash + git clone https://gitee.com/Drayce/jenkins-test.git + cd jenkins-test + ``` +2. 恢复依赖项: + ```bash + dotnet restore + ``` +3. 构建项目: + ```bash + dotnet build + ``` +4. 运行项目: + ```bash + dotnet run --project JenkinsTest/JenkinsTest.Web.Entry/JenkinsTest.Web.Entry.csproj + ``` + +### 数据库迁移 +如果需要更新数据库结构,请运行以下命令: +```bash +dotnet ef database update --project JenkinsTest/JenkinsTest.Database.Migrations/JenkinsTest.Database.Migrations.csproj +``` + +## 使用说明 +项目启动后,可以通过访问以下 API 接口: +- `GET /api/system/description`:获取系统描述信息。 +- `GET /api/system/date`:获取当前系统时间。 +- `GET /api/system/ip`:获取服务器 IP 地址。 +- `GET /api/system/config`:获取服务器配置信息(异步)。 + +## 贡献指南 +欢迎提交 Pull Request。请确保遵循项目代码规范,并在提交前进行充分测试。 + +## 许可证 +本项目采用 MIT 许可证。详见 [LICENSE](LICENSE) 文件。 \ No newline at end of file -- Gitee