From 142b4473a2fee80b490c9d41db5039f53cbb565c Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Mon, 2 Feb 2026 06:18:25 +0000 Subject: [PATCH] Add README.md --- README.en.md | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 350 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..39a676c --- /dev/null +++ b/README.en.md @@ -0,0 +1,174 @@ +# BaitaTakeout - Microservice Food Delivery System + +This is a microservice-based food delivery platform built on Spring Cloud, designed with a front-end and back-end separation architecture. + +## Project Introduction + +BaitaTakeout is a complete food ordering platform supporting features such as users browsing products, placing orders, and merchants managing stores and products. The system adopts a microservice architecture, offering excellent scalability and maintainability. + +## Technology Stack + +- **Backend Framework**: Spring Boot 2.x / Spring Cloud +- **Database**: MySQL +- **ORM Framework**: MyBatis Plus +- **Service Discovery**: Nacos (with @EnableDiscoveryClient enabled) +- **API Style**: RESTful API +- **Data Format**: JSON + +## Project Structure + +``` +BaitaTakeout/ +├── cloud-common/ # Common Module +│ └── Result.java # Unified Response Wrapper Class +├── cloud-database/ # Database Entity Module +│ ├── TGoods.java # Product Entity +│ ├── TMerchant.java # Merchant Entity +│ ├── TOrder.java # Order Entity +│ └── TUser.java # User Entity +├── goods-service/ # Product Service +│ ├── GoodsApp.java # Main Application Class +│ ├── MerchantController.java +│ ├── TGoodsMapper.java +│ ├── TGoodsService.java +│ └── TGoodsServiceImpl.java +├── merchant-service/ # Merchant Service +│ ├── MerchantApp.java +│ ├── MerchantController.java +│ ├── TMerchantMapper.java +│ ├── TMerchantService.java +│ └── TMerchantServiceImpl.java +├── order-service/ # Order Service +│ ├── TOrderMapper.java +│ ├── TOrderService.java +│ └── TOrderServiceImpl.java +└── user-service/ # User Service + ├── TUserMapper.java + ├── TUserService.java + └── TUserServiceImpl.java +``` + +## Core Features + +### User Module +- User registration and login +- User profile management + +### Merchant Module +- Merchant registration and login +- Store information management +- Product management + +### Product Module +- Product list query +- Product information management + +### Order Module +- Order placement +- Order status management +- Order history + +## Database Design + +### t_goods (Product Table) +| Field | Type | Description | +|-------|------|-------------| +| merchant_id | Long | Merchant ID | +| name | String | Product name | +| price | BigDecimal | Price | +| stock | Integer | Stock quantity | +| status | Integer | Status | + +### t_merchant (Merchant Table) +| Field | Type | Description | +|-------|------|-------------| +| name | String | Merchant name | +| account | String | Account | +| password | String | Password | +| status | Integer | Status | + +### t_order (Order Table) +| Field | Type | Description | +|-------|------|-------------| +| id | String | Order ID | +| user_id | Long | User ID | +| merchant_id | Long | Merchant ID | +| total_amount | BigDecimal | Total amount | +| status | Integer | Order status | +| create_time | Date | Creation time | + +### t_user (User Table) +| Field | Type | Description | +|-------|------|-------------| +| phone | String | Phone number (primary key) | +| password | String | Password | +| nickname | String | Nickname | +| create_time | Date | Creation time | + +## Quick Start + +### Environment Requirements +- JDK 1.8+ +- Maven 3.0+ +- MySQL 5.7+ +- Nacos (optional, for service discovery) + +### Build the Project + +```bash +# Clone the project +git clone https://gitee.com/project-team_33/BaitaTakeout.git + +# Enter the project directory +cd BaitaTakeout + +# Build the project +mvn clean install -DskipTests +``` + +### Start Services + +Start the microservices in the following order: + +1. **Start the Registration Center** (e.g., Nacos) +2. **user-service**: `mvn spring-boot:run` or run `UserApp.java` +3. **merchant-service**: `mvn spring-boot:run` or run `MerchantApp.java` +4. **goods-service**: `mvn spring-boot:run` or run `GoodsApp.java` +5. **order-service**: `mvn spring-boot:run` or run `OrderApp.java` + +## API Documentation + +### Merchant Service (merchant-service) + +| Method | Path | Description | Parameters | +|--------|------|-------------|------------| +| GET | /merchant | Retrieve all merchants | None | +| POST | /merchant/login | Merchant login | {account, password} | +| POST | /merchant/sign | Merchant registration | {name, account, password} | + +### Product Service (goods-service) + +| Method | Path | Description | Parameters | +|--------|------|-------------|------------| +| GET | /goods | Retrieve all products | None | + +## Unified Response Format + +The system uses a unified response format `Result`: + +```json +{ + "code": 0, + "msg": "success", + "data": {...}, + "result": true +} +``` + +### Response Status Codes +- `code = 0`: Success +- `code != 0`: Failure; specific meaning described in the `msg` field + +## License + +This project is intended solely for learning and research purposes. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1e1f148 --- /dev/null +++ b/README.md @@ -0,0 +1,176 @@ + + +# 白塔外卖 (BaitaTakeout) - 微服务外卖系统 + +这是一个基于 Spring Cloud 的微服务外卖平台系统,采用前后端分离架构设计。 + +## 项目介绍 + +白塔外卖是一个完整的外卖订购平台,支持用户浏览商品、下单,商家管理店铺和商品等功能。系统采用微服务架构,具有良好的可扩展性和可维护性。 + +## 技术栈 + +- **后端框架**: Spring Boot 2.x / Spring Cloud +- **数据库**: MySQL +- **ORM框架**: MyBatis Plus +- **服务发现**: Nacos (启用@EnableDiscoveryClient) +- **接口风格**: RESTful API +- **数据格式**: JSON + +## 项目结构 + +``` +BaitaTakeout/ +├── cloud-common/ # 公共模块 +│ └── Result.java # 统一响应结果封装类 +├── cloud-database/ # 数据库实体模块 +│ ├── TGoods.java # 商品实体 +│ ├── TMerchant.java # 商家实体 +│ ├── TOrder.java # 订单实体 +│ └── TUser.java # 用户实体 +├── goods-service/ # 商品服务 +│ ├── GoodsApp.java # 启动类 +│ ├── MerchantController.java +│ ├── TGoodsMapper.java +│ ├── TGoodsService.java +│ └── TGoodsServiceImpl.java +├── merchant-service/ # 商家服务 +│ ├── MerchantApp.java +│ ├── MerchantController.java +│ ├── TMerchantMapper.java +│ ├── TMerchantService.java +│ └── TMerchantServiceImpl.java +├── order-service/ # 订单服务 +│ ├── TOrderMapper.java +│ ├── TOrderService.java +│ └── TOrderServiceImpl.java +└── user-service/ # 用户服务 + ├── TUserMapper.java + ├── TUserService.java + └── TUserServiceImpl.java +``` + +## 核心功能 + +### 用户模块 +- 用户注册与登录 +- 用户信息管理 + +### 商家模块 +- 商家注册与登录 +- 店铺信息管理 +- 商品管理 + +### 商品模块 +- 商品列表查询 +- 商品信息管理 + +### 订单模块 +- 下单功能 +- 订单状态管理 +- 订单历史记录 + +## 数据库设计 + +### t_goods (商品表) +| 字段 | 类型 | 说明 | +|------|------|------| +| merchant_id | Long | 商家ID | +| name | String | 商品名称 | +| price | BigDecimal | 价格 | +| stock | Integer | 库存 | +| status | Integer | 状态 | + +### t_merchant (商家表) +| 字段 | 类型 | 说明 | +|------|------|------| +| name | String | 商家名称 | +| account | String | 账号 | +| password | String | 密码 | +| status | Integer | 状态 | + +### t_order (订单表) +| 字段 | 类型 | 说明 | +|------|------|------| +| id | String | 订单ID | +| user_id | Long | 用户ID | +| merchant_id | Long | 商家ID | +| total_amount | BigDecimal | 订单金额 | +| status | Integer | 订单状态 | +| create_time | Date | 创建时间 | + +### t_user (用户表) +| 字段 | 类型 | 说明 | +|------|------|------| +| phone | String | 手机号(主键) | +| password | String | 密码 | +| nickname | String | 昵称 | +| create_time | Date | 创建时间 | + +## 快速开始 + +### 环境要求 +- JDK 1.8+ +- Maven 3.0+ +- MySQL 5.7+ +- Nacos (可选,用于服务发现) + +### 编译项目 + +```bash +# 克隆项目 +git clone https://gitee.com/project-team_33/BaitaTakeout.git + +# 进入项目目录 +cd BaitaTakeout + +# 编译项目 +mvn clean install -DskipTests +``` + +### 启动服务 + +按照以下顺序启动各个微服务: + +1. **启动注册中心** (如使用Nacos) +2. **user-service**: `mvn spring-boot:run` 或运行 `UserApp.java` +3. **merchant-service**: `mvn spring-boot:run` 或运行 `MerchantApp.java` +4. **goods-service**: `mvn spring-boot:run` 或运行 `GoodsApp.java` +5. **order-service**: `mvn spring-boot:run` 或运行 `OrderApp.java` + +## API 接口文档 + +### 商家服务 (merchant-service) + +| 方法 | 路径 | 说明 | 参数 | +|------|------|------|------| +| GET | /merchant | 获取所有商家列表 | 无 | +| POST | /merchant/login | 商家登录 | {account, password} | +| POST | /merchant/sign | 商家注册 | {name, account, password} | + +### 商品服务 (goods-service) + +| 方法 | 路径 | 说明 | 参数 | +|------|------|------|------| +| GET | /goods | 获取所有商品列表 | 无 | + +## 统一响应格式 + +系统使用统一的响应格式 `Result`: + +```json +{ + "code": 0, + "msg": "success", + "data": {...}, + "result": true +} +``` + +### 响应状态码 +- `code = 0`: 成功 +- `code != 0`: 失败,具体含义见 msg 字段 + +## 许可证 + +本项目仅供学习和研究使用。 \ No newline at end of file -- Gitee