41 lines
2.2 KiB
Markdown
41 lines
2.2 KiB
Markdown
# 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.
|
|
|