How lipengjun92/platform-wxshop works
Main Components
• Backend Modules:
– platform-admin: The administrative/backend management module (Spring MVC-based, using MyBatisPlus, with integrated aspects (AOP) for caching, logging, and data filtering). It handles business logic and system configuration.
– platform-api: The RESTful API layer targeted at the WeChat mini-program. It handles public interfaces, authentication, and transactions related to shopping, orders, and goods.
– platform-schedule: The module for scheduling and executing periodic tasks in the system.
– platform-common: The common library which serves cross-cutting concerns (utility functions, caching, authentication, shiro security, logging, and file upload/OSS support).
– platform-gen: A separate code generation module which helps automate the creation of code (DAO, Service, Controller, templates).
• Frontend Modules:
– uni-mall: A uniapp-based front-end center for the mall optimized for cross-platform use.
– wx-mall: A native WeChat mini-program implementation.
• Database and Infrastructure:
– _sql scripts: Database initialization scripts (for the core platform and region data).
– Cache/Redis integration (configured using j2cache.properties).
• Other elements:
– Payment integrations: WeChat payment configuration and related certificates.
– External service integrations such as SMS, Weixin Java SDK, and possibly third-party authentication.
Relationships and Interactions
• The Customer places orders via the client front-ends (uni-mall and wx-mall) which connect through the platform-api.
• The platform-admin serves as the backend management console where administrators can manage goods, orders, users, etc.
• The platform-common module acts as a shared library providing utilities and common service implementations to both the admin and API modules.
• The platform-gen module interacts mostly during the development phase to generate code/templates that are then used by the other modules.
• The platform-schedule module runs scheduled tasks (e.g., maintenance or periodic business logic) and interacts with the common database and caching infrastructure.
• All backend modules interact with the MySQL database as their persistence store and utilize Redis for caching and session management.
• External integrations (payment, SMS, certificate-based communications) are configured in the properties under platform-admin and platform-api, ensuring that data flows securely between third parties and the platform.
Architectural and Design Patterns
• Layered Architecture: Clearly separate the presentation (web and API), business logic (service layer), data access (DAO/Mapper layer), and infrastructure (common utilities and external APIs).
• Modularization: Each submodule (admin, API, common, schedule, gen) functions as a distinct layer/component.
• Cross-Cutting Concerns: Use of AOP aspects for logging, caching, and data filtering.
• RESTful Communication: The API layer communicates with front-end clients through well-defined REST endpoints.
• Code Generation: The platform-gen module implements a template-based approach for generating CRUD interfaces, ensuring consistent architecture.
• Authentication & Security: Integration with shiro (as seen in the common module) and token-based API authentication.
Relevant Technologies and Frameworks
• Java (and specifically Java 11 is recommended)
• Spring MVC for the web framework, integrated with MyBatisPlus for ORM.
• Redis (with J2Cache) for caching.
• Payment integration using Weixin (WeChat) Java SDK.
• Frontend using uniapp (uni-mall) and native WeChat components (wx-mall) for mobile e-commerce.
• Maven for project build and dependency management.
• Code generation using template engines (based on velocity templates as seen in platform-gen).