test: sync contract

This commit is contained in:
2025-10-31 16:15:47 +08:00
parent 1a615c9374
commit 7ea83200d2
3 changed files with 284 additions and 1 deletions

40
AGENTS.md Normal file
View File

@@ -0,0 +1,40 @@
# Repository Guidelines
## Project Structure & Module Organization
- Source code: `src/main/java/com/point/strategy/**` (controllers, services, mappers, beans)
- Resources: `src/main/resources/` (MyBatis `mapper/*.xml`, fonts, config, codegen `generatorConfig.xml`)
- Web assets: `src/main/webapp/**` (static pages, templates, pdf assets)
- Libraries: `src/main/lib/*.jar` (bundled into WAR via `maven-war-plugin`)
- SQL and logs: `sql/`, `logs/`
- Build output: `target/` (WAR: `point-strategy.war`)
## Build, Test, and Development Commands
- Verify environment: `mvn -v` (Java 8, Maven required)
- Build WAR: `mvn clean package -DskipTests`
- Run tests: `mvn test`
- Regenerate MyBatis artifacts (optional): `mvn mybatis-generator:generate` (uses `src/main/resources/generatorConfig.xml`)
- Deploy: copy WAR from `target/` to an external Servlet container (e.g., Tomcat 9+). This project packages as `war` with Tomcat set to `provided`.
## Coding Style & Naming Conventions
- Java 8, 4-space indentation, max line ~120 chars.
- Packages: `com.point.strategy.<module>`
- Classes `UpperCamelCase`; methods/fields `lowerCamelCase`; constants `UPPER_SNAKE_CASE`.
- Suffixes: controllers `*Controller`, services `*Service`, mappers `*Mapper`, entities/VOs `*Entity`/`*VO`.
- Prefer Lombok where present; avoid boilerplate duplication.
## Testing Guidelines
- Framework: Spring Boot Test + JUnit (vintage excluded).
- Naming: place tests under same package, file ends with `*Test.java`.
- Run all tests: `mvn test`; run a class: `mvn -Dtest=ClassNameTest test`.
- Aim for coverage of services and mappers; add lightweight controller tests for critical endpoints.
## Commit & Pull Request Guidelines
- Commit messages: short imperative subject; optionally follow Conventional Commits (e.g., `feat: ...`, `fix: ...`).
- PRs must include: concise description, rationale, screenshots for UI-impacting changes, and linked issue (e.g., `Closes #123`).
- Keep PRs focused; update tests/resources when touching mappers or SQL.
## Security & Configuration Tips
- Do not commit secrets; externalize DB credentials and keystores.
- Verify bundled JARs in `src/main/lib/` are necessary and licensed.
- Large file outputs and logs should be gitignored; use `logs/` for local runs.