$ show macrozheng/mall
This is a comprehensive e-commerce backend platform built with Spring Boot 3.5+, JDK 17, and a multi-module Maven architecture. In production, it serves two distinct APIs: `mall-admin` (admin management) and `mall-portal` (customer-facing storefront), plus a dedicated `mall-search` module for Elasticsearch-powered product search. The system handles product cataloging, order lifecycle management, user registration/authentication, coupon and promotion calculations, shopping cart operations, payment integration (Alipay), and content management (home page banners, recommendations). It uses MySQL as the primary database via MyBatis (with generated mappers), Redis for caching and session management, MongoDB for user activity data (browsing history, favorites), RabbitMQ for delayed order cancellation, and MinIO/Aliyun OSS for file storage. Security is implemented with Spring Security and JWT, including dynamic path-based authorization. The codebase follows a layered architecture (Controller → Service → Mapper/DAO) with shared modules `mall-common` and `mall-security` providing reusable utilities for API responses, pagination, exception handling, Redis caching, and authentication. While heavily reliant on MyBatis Generator for data access objects and includes some long service methods, the overall structure is well-organized and modular, making it suitable as a reference for similar e-commerce projects. No data research or analytical components are present; this is purely an application codebase.
The LLM identified 5 files worth highlighting for reuse:
Provides a generic API response envelope (code, message, data) with static factory methods for success, failed, and error scenarios. Depends only on IErrorCode and ResultCode interfaces within the same module, so it can be extracted as a standalone utility for any Spring Boot project requiring consistent REST responses.
Encapsulates JWT token generation, validation, and refresh logic using the jjwt library. Configurable via properties (secret, expiration). Isolated from business logic, it can be reused in any Spring Security project for token-based authentication without modification.
Implements a custom AuthorizationManager that checks request paths against a dynamic set of resource-to-role mappings provided by a DynamicSecurityService interface. This pattern allows hot-reloadable authorization rules without restarting the application. The implementation is self-contained and depends only on the two interfaces defined in the same security module.
An AOP aspect that intercepts methods annotated with @CacheException and catches Redis connectivity failures, throwing a meaningful exception instead of allowing silent degradation. This is a robust pattern for handling cache unavailability in Redis-backed services, easily adaptable to other caching providers.
An AOP aspect that logs controller request details (URL, HTTP method, IP, class method, arguments, response time) in a structured WebLog object. Uses Logstash markers for centralized logging. Isolated from business logic, it can be reused in any Spring MVC application for request auditing and performance monitoring.