# SpringCloud **Repository Path**: bfs1201/SpringCloud ## Basic Information - **Project Name**: SpringCloud - **Description**: 乐购商场:微服务架构的商城系统 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-06-05 - **Last Updated**: 2026-04-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hippo Mall (SpringCloud) Hippo Mall is a microservice-based e-commerce platform built on Spring Cloud, providing core e-commerce functionalities such as product management, shopping cart, orders, payments, and user management. ## Project Architecture This project adopts a microservice architecture and includes the following services: | Service | Port | Description | |---------|------|-------------| | hm-gateway | 8080 | API Gateway | | item-service | 8081 | Product Service | | user-service | 8082 | User Service | | cart-service | 8083 | Shopping Cart Service | | order-service | 8084 | Order Service | | pay-service | 8085 | Payment Service | ## Technology Stack - **Microservices Framework**: Spring Cloud - **Service Registration/Discovery**: Spring Cloud Netflix Eureka - **Gateway**: Spring Cloud Gateway - **Load Balancing**: OpenFeign + Ribbon - **Database**: MySQL + MyBatis Plus - **Message Queue**: RabbitMQ - **Authentication**: JWT ## Core Features ### Product Service (item-service) - Paginated product queries - Batch and individual product queries - Create, update, and delete products - Inventory deduction ### User Service (user-service) - User login (JWT authentication) - Delivery address management - Balance deduction ### Shopping Cart Service (cart-service) - Add products to cart - Query cart list - Delete or batch delete cart items ### Order Service (order-service) - Create orders - Query orders - Listen for payment status changes - Delayed order cancellation ### Payment Service (pay-service) - Generate payment orders - Balance payment - Query payment status ## Quick Start ### Environment Requirements - JDK 17+ - Maven 3.8+ - MySQL 8.0+ - RabbitMQ 3.8+ ### Configuration Details Configuration files for each service are located under `src/main/resources/`: - `bootstrap.yaml` - Startup configuration - `application.yaml` - General configuration - `application-local.yaml` - Local development configuration - `application-dev.yaml` - Development environment configuration ### Build and Run ```bash # Build the entire project mvn clean package -DskipTests # Start the gateway java -jar hm-gateway/target/hm-gateway.jar # Start microservices in dependency order java -jar item-service/target/item-service.jar java -jar user-service/target/user-service.jar java -jar cart-service/target/cart-service.jar java -jar order-service/target/order-service.jar java -jar pay-service/target/pay-service.jar ``` ## API Gateway All requests are routed through the gateway: ``` http://localhost:8080/{service-path}/{endpoint} ``` Examples: - `GET /item-service/items/page?pageNum=1&pageSize=10` - `GET /user-service/users/login` - `POST /cart-service/carts` ## Module Description ### hm-api Feign client interface definition module, used by other services for remote calls. ### hm-common Common utility module containing: - Unified response structure (R) - Pagination query objects (PageDTO/PageQuery) - Custom exception definitions - Utility classes (BeanUtils, CollUtils, WebUtils, etc.) - User context (UserContext) - Global exception handling (CommonExceptionAdvice) ### hm-gateway API gateway responsible for request routing and JWT authentication. ## License MIT License