diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..341728b138f78f9aea910bc185cf1a960bd057c8 --- /dev/null +++ b/README.en.md @@ -0,0 +1,195 @@ +# BaitaTakeout System + +## Project Overview + +BaitaTakeout is a takeout order management platform built on a microservices architecture using the Spring Cloud ecosystem, providing comprehensive features such as product management and merchant management. The system follows a modular design principle for easy extension and maintenance. + +## System Architecture + +This project adopts a microservices architecture, consisting of the following core service modules: + +``` +BaitaTakeout +├── cloud-common # Common module (utility classes, response encapsulation) +├── cloud-database # Database module (data source configuration, generic Mapper) +├── goods-service # Goods service (CRUD operations, inventory management) +├── merchant-service # Merchant service (merchant management, login authentication) +├── order-service # Order service (order processing, status management) +└── user-service # User service (user management, permission control) +``` + +## Technology Stack + +- **Core Framework**: Spring Boot 2.x / Spring Cloud +- **Service Registration & Discovery**: Nacos +- **Database Access**: MyBatis-Plus +- **Database**: MySQL +- **API Documentation**: Swagger (optional integration) +- **Build Tool**: Maven + +## Module Descriptions + +### cloud-common + +A common dependency module providing system-level utilities: + +- **Unified Response Encapsulation (Result)**: Standardized API response format + - Success response: `Result.success()` / `Result.success(Object data)` + - Failure response: `Result.failure(String msg)` + - Supports custom status codes and message prompts + +### goods-service + +The goods service module responsible for the full lifecycle management of product information: + +- **Core Features**: + - Retrieve product list (`GET /goods`) + - Product information management + - Inventory monitoring + - Product status control + +- **Data Model (TGoods)**: + - Product ID, Merchant ID, Product Name + - Product Price, Stock Quantity, Listing Status + +### merchant-service + +The merchant service module handling merchant-related business logic: + +- **Core Features**: + - Retrieve merchant list (`GET /merchant`) + - Merchant login authentication (`POST /merchant/login`) + - Merchant information management + +- **Data Model (TMerchant)**: + - Merchant ID, Merchant Name, Account Information + - Password Storage, Account Status + +### order-service + +Order service module (under development): + +- Order creation and management +- Order status tracking +- Payment integration + +### user-service + +User service module (under development): + +- User registration and login +- User information management +- Permission control + +## Quick Start + +### Environment Requirements + +- JDK 1.8+ +- Maven 3.6+ +- MySQL 5.7+ / 8.0+ +- Nacos Server + +### Database Configuration + +1. Create a database and execute the initialization script +2. Configure database connections for each service (application.yml / bootstrap.yml) + +### Build and Deployment + +```bash +# Clone the project +git clone https://gitee.com/project-team_33/BaitaTakeout.git + +# Build the project +cd BaitaTakeout +mvn clean install -DskipTests + +# Start services (in dependency order) +java -jar cloud-common/target/cloud-common.jar +java -jar goods-service/target/goods-service.jar +java -jar merchant-service/target/merchant-service.jar +# ... other services +``` + +## API Documentation + +### Unified Response Format + +```json +{ + "code": 0, + "msg": "Operation successful", + "data": {}, + "result": true +} +``` + +### Goods Service Endpoints + +| Method | Endpoint | Description | Parameters | +|--------|----------|-------------|------------| +| GET | /goods | Retrieve all products | None | +| POST | /goods | Create a new product | Product information (JSON) | +| PUT | /goods/{id} | Update product information | Product ID, product information | +| DELETE | /goods/{id} | Delete a product | Product ID | + +### Merchant Service Endpoints + +| Method | Endpoint | Description | Parameters | +|--------|----------|-------------|------------| +| GET | /merchant | Retrieve all merchants | None | +| POST | /merchant/login | Merchant login | Account, password (JSON) | +| POST | /merchant | Register a merchant | Merchant information (JSON) | + +## Database Schema + +### t_goods (Products Table) + +| Field | Type | Description | +|-------|------|-------------| +| id | bigint | Product ID (Primary Key) | +| merchant_id | bigint | Merchant ID | +| name | varchar | Product Name | +| price | decimal | Product Price | +| stock | int | Stock Quantity | +| status | int | Product Status | + +### t_merchant (Merchants Table) + +| Field | Type | Description | +|-------|------|-------------| +| id | bigint | Merchant ID (Primary Key) | +| name | varchar | Merchant Name | +| account | varchar | Login Account | +| password | varchar | Login Password | +| status | int | Account Status | + +## Project Features + +1. **Microservices Architecture**: Independent deployment and scaling +2. **Modular Design**: Clear separation of responsibilities +3. **Standardized Responses**: Uniform API response format +4. **Efficient Development**: Reduced SQL coding with MyBatis-Plus +5. **Easy Extensibility**: Flexible interface design + +## License + +This project is licensed under an open-source license. See the LICENSE file for details. + +## Contribution Guidelines + +1. Fork this repository +2. Create a feature branch (`git checkout -b feature/AmazingFeature`) +3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request + +## Contact + +- Project URL: https://gitee.com/project-team_33/BaitaTakeout +- Feedback: Please submit issues via Gitee Issues + +--- + +**Note**: Some modules (order-service, user-service) are currently under development. Stay tuned for future updates. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..68ab97e5b47434d231025ca946d5cdca8731078d --- /dev/null +++ b/README.md @@ -0,0 +1,192 @@ + + +# 白塔外卖系统 (BaitaTakeout) + +## 项目简介 + +白塔外卖系统是一个基于微服务架构的外卖订单管理平台,采用Spring Cloud生态构建,提供完整的商品管理、商户管理等功能。系统设计遵循模块化原则,便于扩展和维护。 + +## 系统架构 + +本项目采用微服务架构设计,主要包含以下核心服务模块: + +``` +BaitaTakeout +├── cloud-common # 公共模块(通用工具类、响应封装) +├── cloud-database # 数据库模块(数据源配置、通用Mapper) +├── goods-service # 商品服务(商品CRUD、库存管理) +├── merchant-service # 商户服务(商户管理、登录认证) +├── order-service # 订单服务(订单处理、状态管理) +└── user-service # 用户服务(用户管理、权限控制) +``` + +## 技术栈 + +- **核心框架**: Spring Boot 2.x / Spring Cloud +- **服务注册与发现**: Nacos +- **数据库访问**: MyBatis-Plus +- **数据库**: MySQL +- **API文档**: Swagger(可选集成) +- **构建工具**: Maven + +## 模块说明 + +### cloud-common +公共依赖模块,提供系统级的通用功能: + +- **Result统一响应封装**: 标准化API响应格式 + - 成功响应: `Result.success()` / `Result.success(Object data)` + - 失败响应: `Result.failure(String msg)` + - 支持自定义状态码和提示信息 + +### goods-service +商品服务模块,负责商品信息的全生命周期管理: + +- **核心功能**: + - 商品列表查询 (`GET /goods`) + - 商品信息管理 + - 库存监控 + - 商品状态控制 + +- **数据模型** (TGoods): + - 商品ID、商户ID、商品名称 + - 商品价格、库存数量、上架状态 + +### merchant-service +商户服务模块,处理商户相关的业务逻辑: + +- **核心功能**: + - 商户列表查询 (`GET /merchant`) + - 商户登录认证 (`POST /merchant/login`) + - 商户信息管理 + +- **数据模型** (TMerchant): + - 商户ID、商户名称、账号信息 + - 密码存储、账户状态 + +### order-service +订单服务模块(待完善): + +- 订单创建与管理 +- 订单状态追踪 +- 支付集成 + +### user-service +用户服务模块(待完善): + +- 用户注册与登录 +- 用户信息管理 +- 权限控制 + +## 快速开始 + +### 环境要求 + +- JDK 1.8+ +- Maven 3.6+ +- MySQL 5.7+ / 8.0+ +- Nacos Server + +### 数据库配置 + +1. 创建数据库并执行初始化脚本 +2. 配置各服务的数据库连接(application.yml / bootstrap.yml) + +### 编译部署 + +```bash +# 克隆项目 +git clone https://gitee.com/project-team_33/BaitaTakeout.git + +# 编译项目 +cd BaitaTakeout +mvn clean install -DskipTests + +# 启动服务(按依赖顺序) +java -jar cloud-common/target/cloud-common.jar +java -jar goods-service/target/goods-service.jar +java -jar merchant-service/target/merchant-service.jar +# ... 其他服务 +``` + +## API文档 + +### 统一响应格式 + +```json +{ + "code": 0, + "msg": "操作成功", + "data": {}, + "result": true +} +``` + +### 商品服务接口 + +| 请求方式 | 接口地址 | 功能描述 | 参数说明 | +|---------|---------|---------|---------| +| GET | /goods | 获取全部商品列表 | 无 | +| POST | /goods | 新增商品 | 商品信息(JSON) | +| PUT | /goods/{id} | 更新商品信息 | 商品ID、商品信息 | +| DELETE | /goods/{id} | 删除商品 | 商品ID | + +### 商户服务接口 + +| 请求方式 | 接口地址 | 功能描述 | 参数说明 | +|---------|---------|---------|---------| +| GET | /merchant | 获取全部商户列表 | 无 | +| POST | /merchant/login | 商户登录 | 账号、密码(JSON) | +| POST | /merchant | 注册商户 | 商户信息(JSON) | + +## 数据库表结构 + +### t_goods(商品表) + +| 字段名 | 类型 | 说明 | +|-------|------|------| +| id | bigint | 商品ID(主键) | +| merchant_id | bigint | 商户ID | +| name | varchar | 商品名称 | +| price | decimal | 商品价格 | +| stock | int | 库存数量 | +| status | int | 商品状态 | + +### t_merchant(商户表) + +| 字段名 | 类型 | 说明 | +|-------|------|------| +| id | bigint | 商户ID(主键) | +| name | varchar | 商户名称 | +| account | varchar | 登录账号 | +| password | varchar | 登录密码 | +| status | int | 账户状态 | + +## 项目特点 + +1. **微服务架构**: 独立部署、独立扩展 +2. **模块化设计**: 清晰的职责划分 +3. **标准化响应**: 统一的API返回格式 +4. **高效开发**: 基于MyBatis-Plus减少SQL编写 +5. **易于扩展**: 灵活的接口设计 + +## 许可证 + +本项目遵循开源协议,具体许可证信息请参阅 LICENSE 文件。 + +## 贡献指南 + +1. Fork 本仓库 +2. 创建特性分支 (`git checkout -b feature/AmazingFeature`) +3. 提交改动 (`git commit -m 'Add some AmazingFeature'`) +4. 推送到分支 (`git push origin feature/AmazingFeature`) +5. 发起 Pull Request + +## 联系方式 + +- 项目地址: https://gitee.com/project-team_33/BaitaTakeout +- 问题反馈: 请在 Gitee Issues 中提出 + +--- + +**注意**: 部分功能模块(order-service、user-service)仍在开发中,敬请期待后续更新。 \ No newline at end of file