# DDD **Repository Path**: black-meat/ddd ## Basic Information - **Project Name**: DDD - **Description**: DDD架构测试项目 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-16 - **Last Updated**: 2025-12-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DDD Project Description This is a Spring Boot project based on Domain-Driven Design (DDD), designed for building modular and maintainable Java applications. The project structure is clear, including infrastructure layers, resource layers, and common utility classes, making it suitable for backend service development. ## Project Structure - `Application.java`: Spring Boot application entry point. - The `infrastructure` package contains the following common components: - `AutoFillConfig`: Automatic field filling configuration for insert and update operations. - `JacksonObjectMapper`: Custom Jackson serialization configuration. - `PageResult`: Encapsulation class for paginated results. - `Result`: Unified API response encapsulation class. - `CommonException` and `GlobalException`: Global exception handling mechanism. - `LogInterceptor` and `WebConfigurerAdapter`: Request logging interceptor and MVC configuration. - The `resource` package contains resource classes such as `AccountResource`, `CategoryResource`, `DishResource`, and `PaymentResource`, used to handle business logic and expose external interfaces. ## Quick Start ### Prerequisites - JDK 1.8 or higher - Maven 3.x - Spring Boot 2.x ### Installation Steps 1. Clone the project to your local machine: ```bash git clone https://gitee.com/black-meat/ddd.git ``` 2. Navigate to the project directory and build: ```bash cd ddd mvn clean install ``` 3. Run the project: ```bash mvn spring-boot:run ``` ## Usage Instructions - After starting the project, you can interact with resources via endpoints such as `/account`, `/category`, `/dish`, and `/payment`. - All API responses are encapsulated within the `Result` class, ensuring a consistent response format. - Paginated query results are wrapped using `PageResult`, which includes total count and record lists. - Exceptions are captured and handled via `GlobalException`, returning user-friendly error messages. ## Contribution Guidelines Contributions are welcome! Please follow these steps: 1. Fork the project 2. Create a new branch (`git checkout -b feature/new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin feature/new-feature`) 5. Create a Pull Request ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.