This is the backend service for the Zhulin project, built with Spring Boot 3 and Java 21.
- Java 21
- Maven (Wrapper included)
- MySQL 8.0+ OR PostgreSQL 14+
The application supports both MySQL and PostgreSQL. By default, it uses MySQL.
-
Create a database named
zhulinin your database server.- MySQL:
CREATE DATABASE zhulin; - PostgreSQL:
CREATE DATABASE zhulin;
- MySQL:
-
Configure connection settings in
src/main/resources/application-mysql.ymlorsrc/main/resources/application-postgresql.yml.
To use PostgreSQL, change the active profile in src/main/resources/application.yml:
spring:
profiles:
active: postgresqlUsing Maven Wrapper (recommended):
# Windows
./mvnw spring-boot:run
# Linux/Mac
./mvnw spring-boot:runThe server will start on http://localhost:8080.
GET /api/forests- Get all bamboo forestsGET /api/forests/{id}- Get a specific forestPOST /api/forests- Create a new forestPUT /api/forests/{id}- Update a forestDELETE /api/forests/{id}- Delete a forest
(Similar endpoints exist for Fields, Bamboos, etc.)