Spring Boot 3.5 + Java 17 + MyBatis-Plus + PostgreSQL + JWT auth backend.
# env vars required by application.yaml
export databaseHost=localhost databaseUsername=postgres databasePassword=postgres
# build & test
./gradlew build
# run
./gradlew bootRun
# run a single test class
./gradlew test --tests 'space.anyi.serve.ServeApplicationTests'
space.anyi.serve.src/main/java/space/anyi/serve/ServeApplication.javaAuthorization: Bearer <token> header. Public endpoints: /auth/login, /auth/register, /swagger-ui/**, /v3/api-docs/**. Everything else requires auth. Roles: ROLE_admin, ROLE_user, ROLE_expert. Method-level security via @PreAuthorize.BaseMapper<T> + ServiceImpl<M,T>. Logical delete field = deleteFlag. Mapper XML at src/main/resources/mapper/.dev. Credentials from env vars. Druid connection pool.http://localhost:8080/swagger-ui.html (SpringDoc OpenAPI).http://localhost:5173 (Vite dev server).GlobalExceptionHandler returns Response<T> JSON (code, message, data).PageVo<T> wraps MyBatis-Plus Page<T>.@PreAuthorize("hasRole('admin')") for admin-only endpoints.application.yaml uses ${placeholder} for secrets; never hardcode credentials.log-impl: StdOutImpl.management.endpoints.web.exposure.include: "*")./api prefix: Controller @RequestMapping paths must NOT use /api/ prefix (e.g., "posts", "wallet", not "api/posts").entity/*/), not Map. Responses must be VO classes (in entity/*/), not Map.@Schema(description = "..."). Every DTO field must have @Schema and jakarta.validation annotations (@NotBlank, @NotNull, @Size, etc.) with Chinese message.Response<T> with a concrete generic type (DTO or VO). Never raw Response or Response<Map<...>>.| Remote | URL | Push allowed? |
|---|---|---|
gogs |
git@git.anyi.space:gdit/lt_server.git |
Yes — team repo, always push here |
origin |
git@git.anyi.space:yangyi/serve_template.git |
No — personal fork, never push |
Always use git push gogs. Never push to origin.