完善中文协作指南并忽略日志目录

This commit is contained in:
wkc
2026-04-15 15:30:22 +08:00
parent 71c5744b3d
commit 69e1c47940
2 changed files with 22 additions and 20 deletions

2
.gitignore vendored
View File

@@ -45,3 +45,5 @@ nbdist/
!*/build/*.java !*/build/*.java
!*/build/*.html !*/build/*.html
!*/build/*.xml !*/build/*.xml
logs/

View File

@@ -1,27 +1,27 @@
# Repository Guidelines # 仓库协作指南
## Project Structure & Module Organization ## 项目结构与模块组织
This repository follows the RuoYi-Vue split architecture. Backend modules live at the repo root: `ruoyi-admin` is the Spring Boot entry point, `ruoyi-framework` holds security and web infrastructure, `ruoyi-system` contains business services and MyBatis mappers, `ruoyi-common` stores shared utilities, and `ruoyi-quartz` / `ruoyi-generator` provide scheduling and code generation. Frontend code is in `ruoyi-ui`, with pages under `src/views`, API wrappers under `src/api`, shared components under `src/components`, and static assets under `src/assets`. SQL scripts belong in `sql/`, and project documents go in `doc/`. 本仓库采用 RuoYi-Vue 前后端分离架构。后端模块位于仓库根目录:`ruoyi-admin` Spring Boot 启动入口,`ruoyi-framework` 负责安全与 Web 基础设施,`ruoyi-system` 承载业务服务与 MyBatis Mapper`ruoyi-common` 存放公共工具,`ruoyi-quartz` `ruoyi-generator` 分别提供定时任务和代码生成功能。前端代码位于 `ruoyi-ui`,页面放在 `src/views`,接口封装位于 `src/api`,公共组件位于 `src/components`,静态资源位于 `src/assets`SQL 脚本统一放在 `sql/`,项目文档统一放在 `doc/`
## Build, Test, and Development Commands ## 构建、测试与开发命令
Backend: 后端:
- `mvn clean package -DskipTests` builds all Java modules. - `mvn clean package -DskipTests`:构建全部 Java 模块。
- `mvn test` runs backend tests for the full Maven reactor. - `mvn test`:运行整个 Maven 聚合工程的后端测试。
- `mvn -pl ruoyi-admin -am spring-boot:run` starts the admin service with dependent modules. - `mvn -pl ruoyi-admin -am spring-boot:run`:启动管理端服务,并自动构建依赖模块。
Frontend: 前端:
- `cd ruoyi-ui && nvm use && npm install` installs frontend dependencies with Node managed by `nvm`. - `cd ruoyi-ui && nvm use && npm install`:通过 `nvm` 切换并使用项目要求的 Node 版本后安装依赖。
- `cd ruoyi-ui && npm run dev` starts the Vue 2 development server. - `cd ruoyi-ui && npm run dev`:启动 Vue 2 开发服务。
- `cd ruoyi-ui && npm run build:prod` creates the production bundle. - `cd ruoyi-ui && npm run build:prod`:构建生产环境前端产物。
## Coding Style & Naming Conventions ## 编码风格与命名规范
Use 4 spaces for Java indentation and keep packages under `com.ruoyi.<module>`. Follow existing suffixes such as `*Controller`, `*Service`, `*ServiceImpl`, and `*Mapper`; mapper XML files should stay under `src/main/resources/mapper/**`. Vue files follow the existing feature layout, for example `src/views/system/user/index.vue` and `src/api/system/user.js`. Match the repositorys current naming style instead of introducing new patterns. Java 代码统一使用 4 个空格缩进,包路径保持在 `com.ruoyi.<module>` 下。请沿用现有后缀命名,例如 `*Controller``*Service``*ServiceImpl``*Mapper`Mapper XML 文件应继续放在 `src/main/resources/mapper/**` 下。Vue 文件遵循现有功能目录组织方式,例如 `src/views/system/user/index.vue` `src/api/system/user.js`。新增代码时请保持与仓库现有命名风格一致,不要引入新的命名体系。
## Testing Guidelines ## 测试规范
There are currently no committed `src/test` files, so new backend features should add focused tests under `module/src/test/java` using the `*Test` suffix. When changing frontend behavior, at minimum verify `npm run build:prod` succeeds and smoke-test the affected page flow locally. Keep tests narrow and aligned to the module you changed. 当前仓库中尚未发现已提交的 `src/test` 测试文件,因此新增后端功能时,应在对应模块的 `src/test/java` 下补充聚焦型测试类,并使用 `*Test` 作为类名后缀。涉及前端改动时,至少需要验证 `npm run build:prod` 可以成功执行,并对相关页面流程进行本地冒烟验证。测试范围应聚焦于本次改动所在模块,避免无关扩散。
## Commit & Pull Request Guidelines ## 提交与 Pull Request 规范
Current history is minimal (`init`), so keep commit messages short, specific, and in Chinese, for example `新增贷款定价审批接口`. Ignore `.DS_Store` changes. PRs should state the affected modules, summarize behavior changes, list any SQL or configuration updates, and include screenshots for UI changes. 当前仓库提交历史较少,仅有 `init`,因此提交信息请保持简短、明确,并统一使用中文,例如 `新增贷款定价审批接口`。忽略 `.DS_Store` 文件的变更。提交 PR 时,需要说明影响的模块、概述行为变化、列出 SQL 或配置变更,并在涉及界面调整时附上截图。
## Agent-Specific Notes ## Agent 协作说明
Every change should leave an implementation record in `doc/`. If a feature touches both backend and frontend, maintain separate frontend and backend implementation plans; otherwise, record only the impacted side. 每次改动都必须在 `doc/` 中留下实施记录。如果一个功能同时涉及前端和后端,则需要分别维护前端实施计划和后端实施计划;如果仅涉及单侧改动,则只记录对应侧的实施内容。