From 750237b95dc5d24bc4ab95efe5eea622f136b5ed Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Wed, 12 Nov 2025 04:00:08 +0000 Subject: [PATCH] Add README.md --- README.en.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 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..dec346b --- /dev/null +++ b/README.en.md @@ -0,0 +1,52 @@ +# SpringBoot API Project Documentation + +## Project Overview +This is an API service project based on Spring Boot, providing foundational features such as employee information management and file upload/download. The project adopts a modular design with a clear structure, making it easy to extend. + +## Features +- **Employee Management**: Supports creating, updating, and deleting employee information, along with paginated querying. +- **File Management**: Implements file upload, download, storage, deletion, update, and paginated display. +- **Signature Verification**: Enhances security by validating API requests via an interceptor. +- **Unified Response**: Uses the `BaseResponse` class to encapsulate a consistent response format for easier frontend handling. + +## Technology Stack +- Spring Boot +- MyBatis Plus +- Java 8+ +- Maven + +## Installation and Configuration +1. **Environment Preparation**: Ensure JDK 1.8+ and Maven are installed. +2. **Dependency Installation**: Run `mvn clean install` to install project dependencies. +3. **Database Configuration**: Configure database connection details in `application.yml`. +4. **Start the Project**: Run the `main` method in the `SpringbootapiApplication` class to start the application. + +## Usage Instructions +### Employee Management +- **Create Employee**: POST `/api/createStaff`, request body contains employee information. +- **Update Employee**: PUT `/api/updateStaff`, request body contains updated employee information. +- **Delete Employee**: DELETE `/api/deleteStaff/{staffId}`, where `{staffId}` is the employee ID. +- **Get Employee Info**: GET `/api/staffInfo/{staffId}`, where `{staffId}` is the employee ID. + +### File Management +- **Upload File**: POST `/file/upload`, request body contains the uploaded file. +- **Download File**: GET `/file/download`, parameter is the filename. +- **Save File Info**: POST `/file/save`, request body contains file information. +- **Delete File**: DELETE `/file/remove/{id}`, where `{id}` is the file ID. +- **Update File Info**: PUT `/file/update`, request body contains updated file information. +- **Get File List**: GET `/file/list`, returns all file information. +- **Paginated File List**: GET `/file/page`, returns paginated file information. + +## Security +The project implements API request signature verification via `SignatureInterceptor` to ensure the legitimacy of request sources. Refer to the `SignatureUtil` class for details on signature generation. + +## Contribution Guidelines +Contributions are welcome! Please follow these steps: +1. Fork the project repository. +2. Create a new branch (`git checkout -b feature/new-feature`). +3. Commit your changes (`git commit -am 'Add some feature'`). +4. Push the branch (`git push origin feature/new-feature`). +5. Submit a Pull Request. + +## License +This project is licensed under the MIT License. See the LICENSE file for details. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..942d27a --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# SpringBoot API 项目文档 + +## 项目简介 +这是一个基于Spring Boot的API服务项目,提供了员工信息管理、文件上传下载等基础功能。项目采用模块化设计,结构清晰,易于扩展。 + +## 功能特性 +- **员工管理**:支持创建、更新、删除员工信息,并提供分页查询功能。 +- **文件管理**:实现文件上传、下载、保存、删除、更新及分页展示。 +- **签名验证**:通过拦截器实现API请求的签名验证,增强安全性。 +- **统一响应**:使用`BaseResponse`类封装统一的响应格式,便于前端处理。 + +## 技术栈 +- Spring Boot +- MyBatis Plus +- Java 8+ +- Maven + +## 安装与配置 +1. **环境准备**:确保已安装JDK 1.8+ 和 Maven。 +2. **依赖安装**:运行 `mvn clean install` 安装项目依赖。 +3. **数据库配置**:在 `application.yml` 中配置数据库连接信息。 +4. **启动项目**:运行 `SpringbootapiApplication` 类中的 `main` 方法启动应用。 + +## 使用说明 +### 员工管理 +- **创建员工**:POST `/api/createStaff`,请求体为员工信息。 +- **更新员工**:PUT `/api/updateStaff`,请求体为更新后的员工信息。 +- **删除员工**:DELETE `/api/deleteStaff/{staffId}`,其中 `{staffId}` 为员工ID。 +- **获取员工信息**:GET `/api/staffInfo/{staffId}`,其中 `{staffId}` 为员工ID。 + +### 文件管理 +- **上传文件**:POST `/file/upload`,请求体为上传的文件。 +- **下载文件**:GET `/file/download`,参数为文件名。 +- **保存文件信息**:POST `/file/save`,请求体为文件信息。 +- **删除文件**:DELETE `/file/remove/{id}`,其中 `{id}` 为文件ID。 +- **更新文件信息**:PUT `/file/update`,请求体为更新后的文件信息。 +- **获取文件列表**:GET `/file/list`,返回所有文件信息。 +- **分页获取文件**:GET `/file/page`,返回分页的文件信息。 + +## 安全性 +项目通过 `SignatureInterceptor` 实现API请求的签名验证,确保请求来源的合法性。签名生成方式请参考 `SignatureUtil` 类。 + +## 贡献指南 +欢迎贡献代码!请遵循以下步骤: +1. Fork 项目仓库。 +2. 创建新分支 (`git checkout -b feature/new-feature`)。 +3. 提交更改 (`git commit -am 'Add some feature'`)。 +4. 推送分支 (`git push origin feature/new-feature`)。 +5. 提交 Pull Request。 + +## 许可证 +本项目采用 MIT 许可证。详情请查看 LICENSE 文件。 \ No newline at end of file -- Gitee