How kenshirokk/makemoney001 works
Main Components
• Web Layer (Controllers): Under the "controller" package, you have multiple controllers (e.g., AccountsInfoController, AgencyController, AuthController, etc.). These components receive web requests (likely REST API calls) and are the entry points for client interactions.
• Business Logic Layer (Services): The "service" packages along with their implementations in "service/impl" encapsulate the business logic. For example, LoginService and its implementation, along with service classes for managing bulletins, agency info, game configuration, and so on.
• Data Access Layer (Mappers/Repositories): The "mapper" packages (split between "adminmanager", "qpaccountsdb", and "qpplatformdb") indicate the use of MyBatis (notice the XML mapping files in the resources/mapper folders). This layer handles interactions with the underlying databases.
• Domain Model (Entities and DTO/VO): The "entity" package holds the domain models that correspond to the database tables, while the "dto" and "vo" classes in the "common" subpackages are used to transfer and present data.
• Configuration and Utilities:
• Configuration classes like MvcConfig and SwaggerConfig reside in the "config" package. They set up web MVC and API documentation.
• Utility classes (under "common/util") such as Cryptography, QrCode, and Token provide supporting functionality.
• Custom annotations (e.g., AdminMethod, PublicMethod) and interceptors (like AuthInterceptor) suggest mechanisms for authorization and logging or other cross-cutting concerns.
• Resources and Environment Settings:
• The “src/main/resources” folder holds configuration files (application.yml and its variants) and MyBatis mapper XML files, which detail SQL mappings.
• SQL scripts (found in SQL folder) further indicate where database triggers or other setup commands are maintained.
• Testing: The “src/test” directories contain corresponding tests for controllers, services, and mappers, ensuring the different layers are properly verified.
Mapping Relationships and Interactions
• Controllers delegate requests to Service components which perform the business logic.
• The Service layer then interacts with the Data Access Layer (Mappers) to query or update data in the database.
• A bidirectional interaction between the Service and any external utilities or configurations that enforce security (e.g., via AuthInterceptor and the custom annotations).
Architectural Patterns and Design Principles
• Layered architecture (Presentation, Business, Data Access).
• Use of annotations and interceptors indicates an aspect-oriented approach to handle cross-cutting concerns like authentication.
• Separation of configuration from logic, evident in the dedicated configuration classes and externalized settings.
• Use of MyBatis to abstract SQL interactions, with XML files providing data mapping.